﻿using System;
using System.Collections.Generic;
using Underanalyzer.Compiler;
using UndertaleModLib.Models;
using static UndertaleModLib.Models.UndertaleGeneralInfo;

namespace UndertaleModLib.Compiler;

/// <summary>
/// Record of builtin variable information.
/// </summary>
public record VariableInfo(string Name, bool IsGlobal, bool CanSet, bool IsAutomaticArray = false) : IBuiltinVariable;

/// <summary>
/// Record of builtin function information.
/// </summary>
public record FunctionInfo : IBuiltinFunction
{
    /// <inheritdoc/>
    public string Name { get; }

    /// <inheritdoc/>
    public int MinArguments { get; }

    /// <inheritdoc/>
    public int MaxArguments { get; }

    /// <summary>
    /// Classification of function.
    /// </summary>
    public FunctionClassification Classification { get; } = FunctionClassification.None;

    public FunctionInfo(string name, int numArguments)
    {
        Name = name;
        MinArguments = numArguments;
        MaxArguments = numArguments;
    }

    public FunctionInfo(string name, int minNumArguments, int maxNumArguments)
    {
        Name = name;
        MinArguments = minNumArguments;
        MaxArguments = maxNumArguments;
    }

    public FunctionInfo(string name, int numArguments, FunctionClassification classification) : this(name, numArguments)
    {
        Classification = classification;
    }
}

/// <summary>
/// A long list of known built-in GameMaker constants, functions, and variables. Used for compilation.
/// </summary>
public class BuiltinList : IBuiltins
{
    public Dictionary<string, double> Constants { get; private set; } = null;
    public Dictionary<string, VariableInfo> GlobalNotArray { get; private set; } = null;
    public Dictionary<string, VariableInfo> GlobalArray { get; private set; } = null;
    public Dictionary<string, VariableInfo> Instance { get; private set; } = null;
    public Dictionary<string, VariableInfo> InstanceLimitedEvent { get; private set; } = null;
    public Dictionary<string, FunctionInfo> Functions { get; private set; } = null;

    public BuiltinList() 
    {
        InitializeMain(null);
    }

    public BuiltinList(UndertaleData data)
    {
        InitializeMain(data);
        LoadFunctionsFromData(data);
    }

    /// <inheritdoc/>
    public IBuiltinFunction LookupBuiltinFunction(string name)
    {
        if (Functions.TryGetValue(name, out FunctionInfo function))
        {
            return function;
        }
        return null;
    }

    /// <inheritdoc/>
    public IBuiltinVariable LookupBuiltinVariable(string name)
    {
        if (Instance.TryGetValue(name, out VariableInfo instanceVar))
        {
            return instanceVar;
        }
        if (GlobalNotArray.TryGetValue(name, out VariableInfo globalNotArrayVar))
        {
            return globalNotArrayVar;
        }
        if (GlobalArray.TryGetValue(name, out VariableInfo globalArrayVar))
        {
            return globalArrayVar;
        }
        if (InstanceLimitedEvent.TryGetValue(name, out VariableInfo instanceLimitedVar))
        {
            return instanceLimitedVar;
        }
        return null;
    }

    /// <inheritdoc/>
    public bool LookupConstantDouble(string name, out double value)
    {
        return Constants.TryGetValue(name, out value);
    }

    /// <summary>
    /// Helper function to define a builtin function with any number of arguments.
    /// </summary>
    private void DefineFunction(string name)
    {
        Functions[name] = new FunctionInfo(name, 0, int.MaxValue);
    }

    /// <summary>
    /// Helper function to define a builtin function with a specific number of arguments.
    /// </summary>
    private void DefineFunction(string name, int numArguments)
    {
        Functions[name] = new FunctionInfo(name, numArguments);
    }

    /// <summary>
    /// Helper function to define a builtin function with a specific number of arguments, and a function classification.
    /// </summary>
    private void DefineFunction(string name, int numArguments, FunctionClassification classification)
    {
        Functions[name] = new FunctionInfo(name, numArguments, classification);
    }

    /// <summary>
    /// Loads builtin functions purely based on functions used by game data already.
    /// </summary>
    private void LoadFunctionsFromData(UndertaleData data)
    {
        if (data.Functions is null)
        {
            // No functions (probably YYC), so don't do this
            return;
        }

        // First, make script lookup to avoid script names being marked as builtin
        HashSet<string> scriptLookup = new(data.Scripts.Count);
        foreach (UndertaleScript script in data.Scripts)
        {
            if (script?.Name?.Content is string name && !name.StartsWith("gml_Script_", StringComparison.Ordinal))
            {
                scriptLookup.Add(name);
            }
        }

        // Load in all functions that aren't detected as scripts, and which aren't already builtin functions
        Functions ??= new(data.Functions.Count);
        foreach (UndertaleFunction function in data.Functions)
        {
            if (function?.Name?.Content is string name && !name.StartsWith("gml_Script_", StringComparison.Ordinal) && 
                !scriptLookup.Contains(name) && !Functions.ContainsKey(name))
            {
                DefineFunction(name);
            }
        }
    }

    /// <summary>
    /// Initializes the main builtin data (that is, what the tool intrinsically knows about).
    /// </summary>
    private void InitializeMain(UndertaleData data)
    {
        // Functions
        Functions = new(4096);
        DefineFunction("@@This@@", 0);
        DefineFunction("@@Other@@", 0);
        DefineFunction("@@Global@@", 0);
        DefineFunction("@@GetInstance@@", 1);
        DefineFunction("@@NullObject@@", 0);
        DefineFunction("@@NewGMLObject@@");
        DefineFunction("@@NewGMLArray@@");
        DefineFunction("@@SetStatic@@", 0);
        DefineFunction("@@CopyStatic@@", 1);
        DefineFunction("static_get", 1);
        DefineFunction("@@throw@@", 1);
        DefineFunction("@@try_hook@@", 2);
        DefineFunction("@@try_unhook@@", 0);
        DefineFunction("@@finish_catch@@", 0);
        DefineFunction("@@finish_finally@@", 0);
        DefineFunction("matrix_get", 1);
        DefineFunction("matrix_set", 2);
        DefineFunction("matrix_build", 9);
        DefineFunction("matrix_build_lookat", 9);
        DefineFunction("matrix_build_identity", 0);
        DefineFunction("matrix_build_projection_ortho", 4);
        DefineFunction("matrix_build_projection_perspective", 4);
        DefineFunction("matrix_build_projection_perspective_fov", 4);
        DefineFunction("matrix_multiply", 2);
        DefineFunction("matrix_transform_vertex", 4);
        DefineFunction("matrix_stack_push");
        DefineFunction("matrix_stack_pop", 0);
        DefineFunction("matrix_stack_set", 1);
        DefineFunction("matrix_stack_clear", 0);
        DefineFunction("matrix_stack_top", 0);
        DefineFunction("matrix_stack_is_empty", 0);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("d3d_start", 0);
            DefineFunction("d3d_end", 0);
            DefineFunction("d3d_set_perspective", 1);
            DefineFunction("d3d_set_hidden", 1);
            DefineFunction("d3d_set_depth", 1);
            DefineFunction("d3d_set_shading", 1);
            DefineFunction("d3d_set_fog", 4);
            DefineFunction("d3d_set_culling", 1);
            DefineFunction("d3d_set_zwriteenable", 1);
            DefineFunction("d3d_set_projection", 9);
            DefineFunction("d3d_set_projection_ext", 13);
            DefineFunction("d3d_set_projection_ortho", 5);
            DefineFunction("d3d_set_projection_perspective", 5);
            DefineFunction("d3d_transform_set_identity", 0);
            DefineFunction("d3d_transform_set_translation", 3);
            DefineFunction("d3d_transform_set_scaling", 3);
            DefineFunction("d3d_transform_set_rotation_x", 1);
            DefineFunction("d3d_transform_set_rotation_y", 1);
            DefineFunction("d3d_transform_set_rotation_z", 1);
            DefineFunction("d3d_transform_set_rotation_axis", 4);
            DefineFunction("d3d_transform_add_translation", 3);
            DefineFunction("d3d_transform_add_scaling", 3);
            DefineFunction("d3d_transform_add_rotation_x", 1);
            DefineFunction("d3d_transform_add_rotation_y", 1);
            DefineFunction("d3d_transform_add_rotation_z", 1);
            DefineFunction("d3d_transform_add_rotation_axis", 4);
            DefineFunction("d3d_transform_stack_clear", 0);
            DefineFunction("d3d_transform_stack_empty", 0);
            DefineFunction("d3d_transform_stack_push", 0);
            DefineFunction("d3d_transform_stack_pop", 0);
            DefineFunction("d3d_transform_stack_top", 0);
            DefineFunction("d3d_transform_stack_discard", 0);
            DefineFunction("d3d_transform_vertex", 3);
            DefineFunction("d3d_primitive_begin", 1);
            DefineFunction("d3d_primitive_begin_texture", 2);
            DefineFunction("d3d_primitive_end", 0);
            DefineFunction("d3d_vertex", 3);
            DefineFunction("d3d_vertex_color", 5);
            DefineFunction("d3d_vertex_colour", 5);
            DefineFunction("d3d_vertex_texture", 5);
            DefineFunction("d3d_vertex_texture_color", 7);
            DefineFunction("d3d_vertex_texture_colour", 7);
            DefineFunction("d3d_vertex_normal", 6);
            DefineFunction("d3d_vertex_normal_color", 8);
            DefineFunction("d3d_vertex_normal_colour", 8);
            DefineFunction("d3d_vertex_normal_texture", 8);
            DefineFunction("d3d_vertex_normal_texture_color", 10);
            DefineFunction("d3d_vertex_normal_texture_colour", 10);
            DefineFunction("d3d_draw_block", 9);
            DefineFunction("d3d_draw_cylinder", 11);
            DefineFunction("d3d_draw_cone", 11);
            DefineFunction("d3d_draw_ellipsoid", 10);
            DefineFunction("d3d_draw_wall", 9);
            DefineFunction("d3d_draw_floor", 9);
            DefineFunction("d3d_model_create", 0);
            DefineFunction("d3d_model_destroy", 1);
            DefineFunction("d3d_model_clear", 1);
            DefineFunction("d3d_model_load", 2);
            DefineFunction("d3d_model_save", 2);
            DefineFunction("d3d_model_load_buffer", 2);
            DefineFunction("d3d_model_save_buffer", 2);
            DefineFunction("d3d_model_draw", 5);
            DefineFunction("d3d_model_primitive_begin", 2);
            DefineFunction("d3d_model_primitive_end", 1);
            DefineFunction("d3d_model_vertex", 4);
            DefineFunction("d3d_model_vertex_color", 6);
            DefineFunction("d3d_model_vertex_colour", 6);
            DefineFunction("d3d_model_vertex_texture", 6);
            DefineFunction("d3d_model_vertex_texture_color", 8);
            DefineFunction("d3d_model_vertex_texture_colour", 8);
            DefineFunction("d3d_model_vertex_normal", 7);
            DefineFunction("d3d_model_vertex_normal_color", 9);
            DefineFunction("d3d_model_vertex_normal_colour", 9);
            DefineFunction("d3d_model_vertex_normal_texture", 9);
            DefineFunction("d3d_model_vertex_normal_texture_color", 11);
            DefineFunction("d3d_model_vertex_normal_texture_colour", 11);
            DefineFunction("d3d_model_block", 9);
            DefineFunction("d3d_model_cylinder", 11);
            DefineFunction("d3d_model_cone", 11);
            DefineFunction("d3d_model_ellipsoid", 10);
            DefineFunction("d3d_model_wall", 9);
            DefineFunction("d3d_model_floor", 9);
            DefineFunction("d3d_light_define_ambient", 1);
            DefineFunction("d3d_light_define_direction", 5);
            DefineFunction("d3d_light_define_point", 6);
            DefineFunction("d3d_light_enable", 2);
            DefineFunction("d3d_set_lighting", 1);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("action_path_old", 3);
            DefineFunction("action_set_sprite", 2);
            DefineFunction("action_draw_font", 1);
            DefineFunction("action_draw_font_old", 6);
            DefineFunction("action_fill_color", 1);
            DefineFunction("action_fill_colour", 1);
            DefineFunction("action_line_color", 1);
            DefineFunction("action_line_colour", 1);
            DefineFunction("action_highscore", 0);
            DefineFunction("action_set_relative", 1);
            DefineFunction("action_move", 2);
            DefineFunction("action_set_motion", 2);
            DefineFunction("action_set_hspeed", 1);
            DefineFunction("action_set_vspeed", 1);
            DefineFunction("action_set_gravity", 2);
            DefineFunction("action_set_friction", 1);
            DefineFunction("action_move_point", 3);
            DefineFunction("action_move_to", 2);
            DefineFunction("action_move_start", 0);
            DefineFunction("action_move_random", 2);
            DefineFunction("action_snap", 2);
            DefineFunction("action_wrap", 1);
            DefineFunction("action_reverse_xdir", 0);
            DefineFunction("action_reverse_ydir", 0);
            DefineFunction("action_move_contact", 3);
            DefineFunction("action_bounce", 2);
            DefineFunction("action_path", 4);
            DefineFunction("action_path_end", 0);
            DefineFunction("action_path_position", 1);
            DefineFunction("action_path_speed", 1);
            DefineFunction("action_linear_step", 4);
            DefineFunction("action_potential_step", 4);
            DefineFunction("action_kill_object", 0);
            DefineFunction("action_create_object", 3);
            DefineFunction("action_create_object_motion", 5);
            DefineFunction("action_create_object_random", 6);
            DefineFunction("action_change_object", 2);
            DefineFunction("action_kill_position", 2);
            DefineFunction("action_sprite_set", 3);
            DefineFunction("action_sprite_transform", 4);
            DefineFunction("action_sprite_color", 2);
            DefineFunction("action_sprite_colour", 2);
            DefineFunction("action_sound", 2);
            DefineFunction("action_end_sound", 1);
            DefineFunction("action_if_sound", 1);
            DefineFunction("action_another_room", 1);
            DefineFunction("action_current_room", 0);
            DefineFunction("action_previous_room", 0);
            DefineFunction("action_next_room", 0);
            DefineFunction("action_if_previous_room", 0);
            DefineFunction("action_if_next_room", 0);
            DefineFunction("action_set_alarm", 2);
            DefineFunction("action_sleep", 2);
            DefineFunction("action_set_timeline", 2);
            DefineFunction("action_timeline_set", 4);
            DefineFunction("action_timeline_start", 0);
            DefineFunction("action_timeline_stop", 0);
            DefineFunction("action_timeline_pause", 0);
            DefineFunction("action_set_timeline_position", 1);
            DefineFunction("action_set_timeline_speed", 1);
            DefineFunction("action_message", 1);
            DefineFunction("action_show_info", 0);
            DefineFunction("action_show_video", 3);
            DefineFunction("action_end_game", 0);
            DefineFunction("action_restart_game", 0);
            DefineFunction("action_save_game", 1);
            DefineFunction("action_load_game", 1);
            DefineFunction("action_replace_sprite", 3);
            DefineFunction("action_replace_sound", 2);
            DefineFunction("action_replace_background", 2);
            DefineFunction("action_if_empty", 3);
            DefineFunction("action_if_collision", 3);
            DefineFunction("action_if", 1);
            DefineFunction("action_if_number", 3);
            DefineFunction("action_if_object", 3);
            DefineFunction("action_if_question", 1);
            DefineFunction("action_if_dice", 1);
            DefineFunction("action_if_mouse", 1);
            DefineFunction("action_if_aligned", 2);
            DefineFunction("action_execute_script", 6);
            DefineFunction("action_inherited", 0);
            DefineFunction("action_if_variable", 3);
            DefineFunction("action_draw_variable", 3);
            DefineFunction("action_set_score", 1);
            DefineFunction("action_if_score", 2);
            DefineFunction("action_draw_score", 3);
            DefineFunction("action_highscore_show", 11);
            DefineFunction("action_highscore_clear", 0);
            DefineFunction("action_set_life", 1);
            DefineFunction("action_if_life", 2);
            DefineFunction("action_draw_life", 3);
            DefineFunction("action_draw_life_images", 3);
            DefineFunction("action_set_health", 1);
            DefineFunction("action_if_health", 2);
            DefineFunction("action_draw_health", 6);
            DefineFunction("action_set_caption", 6);
            DefineFunction("action_partsyst_create", 1);
            DefineFunction("action_partsyst_destroy", 0);
            DefineFunction("action_partsyst_clear", 0);
            DefineFunction("action_parttype_create_old", 6);
            DefineFunction("action_parttype_create", 6);
            DefineFunction("action_parttype_color", 6);
            DefineFunction("action_parttype_colour", 6);
            DefineFunction("action_parttype_life", 3);
            DefineFunction("action_parttype_speed", 6);
            DefineFunction("action_parttype_gravity", 3);
            DefineFunction("action_parttype_secondary", 5);
            DefineFunction("action_partemit_create", 6);
            DefineFunction("action_partemit_destroy", 1);
            DefineFunction("action_partemit_burst", 3);
            DefineFunction("action_partemit_stream", 3);
            DefineFunction("action_cd_play", 2);
            DefineFunction("action_cd_stop", 0);
            DefineFunction("action_cd_pause", 0);
            DefineFunction("action_cd_resume", 0);
            DefineFunction("action_cd_present", 0);
            DefineFunction("action_cd_playing", 0);
            DefineFunction("action_set_cursor", 2);
            DefineFunction("action_webpage", 1);
            DefineFunction("action_splash_web", 1);
            DefineFunction("action_draw_sprite", 4);
            DefineFunction("action_draw_background", 4);
            DefineFunction("action_draw_text", 3);
            DefineFunction("action_draw_text_transformed", 6);
            DefineFunction("action_draw_rectangle", 5);
            DefineFunction("action_draw_gradient_hor", 6);
            DefineFunction("action_draw_gradient_vert", 6);
            DefineFunction("action_draw_ellipse", 5);
            DefineFunction("action_draw_ellipse_gradient", 6);
            DefineFunction("action_draw_line", 4);
            DefineFunction("action_draw_arrow", 5);
            DefineFunction("action_color", 1);
            DefineFunction("action_colour", 1);
            DefineFunction("action_font", 2);
            DefineFunction("action_fullscreen", 1);
            DefineFunction("action_snapshot", 1);
            DefineFunction("action_effect", 6);
        }
        DefineFunction("ds_set_precision", 1);
        DefineFunction("ds_exists", 2);
        DefineFunction("ds_stack_create", 0);
        DefineFunction("ds_stack_destroy", 1);
        DefineFunction("ds_stack_clear", 1);
        DefineFunction("ds_stack_copy", 2);
        DefineFunction("ds_stack_size", 1);
        DefineFunction("ds_stack_empty", 1);
        DefineFunction("ds_stack_push");
        DefineFunction("ds_stack_pop", 1);
        DefineFunction("ds_stack_top", 1);
        DefineFunction("ds_stack_write", 1);
        DefineFunction("ds_stack_read");
        DefineFunction("ds_queue_create", 0);
        DefineFunction("ds_queue_destroy", 1);
        DefineFunction("ds_queue_clear", 1);
        DefineFunction("ds_queue_copy", 2);
        DefineFunction("ds_queue_size", 1);
        DefineFunction("ds_queue_empty", 1);
        DefineFunction("ds_queue_enqueue");
        DefineFunction("ds_queue_dequeue", 1);
        DefineFunction("ds_queue_head", 1);
        DefineFunction("ds_queue_tail", 1);
        DefineFunction("ds_queue_write", 1);
        DefineFunction("ds_queue_read");
        DefineFunction("ds_list_create", 0);
        DefineFunction("ds_list_destroy", 1);
        DefineFunction("ds_list_clear", 1);
        DefineFunction("ds_list_copy", 2);
        DefineFunction("ds_list_size", 1);
        DefineFunction("ds_list_empty", 1);
        DefineFunction("ds_list_add");
        DefineFunction("ds_list_insert", 3);
        DefineFunction("ds_list_replace", 3);
        DefineFunction("ds_list_delete", 2);
        DefineFunction("ds_list_find_index", 2);
        DefineFunction("ds_list_find_value", 2);
        DefineFunction("ds_list_mark_as_list", 2);
        DefineFunction("ds_list_mark_as_map", 2);
        DefineFunction("ds_list_sort", 2);
        DefineFunction("ds_list_shuffle", 1);
        DefineFunction("ds_list_write", 1);
        DefineFunction("ds_list_read");
        DefineFunction("ds_list_set", 3);
        DefineFunction("ds_list_set_pre", 3);
        DefineFunction("ds_list_set_post", 3);
        DefineFunction("ds_map_create", 0);
        DefineFunction("ds_map_destroy", 1);
        DefineFunction("ds_map_clear", 1);
        DefineFunction("ds_map_copy", 2);
        DefineFunction("ds_map_size", 1);
        DefineFunction("ds_map_empty", 1);
        DefineFunction("ds_map_add", 3);
        DefineFunction("ds_map_add_list", 3);
        DefineFunction("ds_map_add_map", 3);
        DefineFunction("ds_map_replace", 3);
        DefineFunction("ds_map_replace_list", 3);
        DefineFunction("ds_map_replace_map", 3);
        DefineFunction("ds_map_delete", 2);
        DefineFunction("ds_map_exists", 2);
        DefineFunction("ds_map_find_value", 2);
        DefineFunction("ds_map_find_previous", 2);
        DefineFunction("ds_map_find_next", 2);
        DefineFunction("ds_map_find_first", 1);
        DefineFunction("ds_map_find_last", 1);
        DefineFunction("ds_map_write", 1);
        DefineFunction("ds_map_read");
        DefineFunction("ds_map_secure_save", 2);
        DefineFunction("ds_map_secure_load", 1);
        DefineFunction("ds_map_secure_load_buffer", 1);
        DefineFunction("ds_map_secure_save_buffer", 2);
        DefineFunction("ds_map_set", 3);
        DefineFunction("ds_map_set_pre", 3);
        DefineFunction("ds_map_set_post", 3);
        DefineFunction("ds_priority_create", 0);
        DefineFunction("ds_priority_destroy", 1);
        DefineFunction("ds_priority_clear", 1);
        DefineFunction("ds_priority_copy", 2);
        DefineFunction("ds_priority_size", 1);
        DefineFunction("ds_priority_empty", 1);
        DefineFunction("ds_priority_add", 3);
        DefineFunction("ds_priority_change_priority", 3);
        DefineFunction("ds_priority_find_priority", 2);
        DefineFunction("ds_priority_delete_value", 2);
        DefineFunction("ds_priority_delete_min", 1);
        DefineFunction("ds_priority_find_min", 1);
        DefineFunction("ds_priority_delete_max", 1);
        DefineFunction("ds_priority_find_max", 1);
        DefineFunction("ds_priority_write", 1);
        DefineFunction("ds_priority_read");
        DefineFunction("ds_grid_create", 2);
        DefineFunction("ds_grid_destroy", 1);
        DefineFunction("ds_grid_copy", 2);
        DefineFunction("ds_grid_resize", 3);
        DefineFunction("ds_grid_width", 1);
        DefineFunction("ds_grid_height", 1);
        DefineFunction("ds_grid_clear", 2);
        DefineFunction("ds_grid_set", 4);
        DefineFunction("ds_grid_add", 4);
        DefineFunction("ds_grid_multiply", 4);
        DefineFunction("ds_grid_set_region", 6);
        DefineFunction("ds_grid_add_region", 6);
        DefineFunction("ds_grid_multiply_region", 6);
        DefineFunction("ds_grid_set_disk", 5);
        DefineFunction("ds_grid_add_disk", 5);
        DefineFunction("ds_grid_multiply_disk", 5);
        DefineFunction("ds_grid_set_grid_region", 8);
        DefineFunction("ds_grid_add_grid_region", 8);
        DefineFunction("ds_grid_multiply_grid_region", 8);
        DefineFunction("ds_grid_get", 3);
        DefineFunction("ds_grid_get_sum", 5);
        DefineFunction("ds_grid_get_max", 5);
        DefineFunction("ds_grid_get_min", 5);
        DefineFunction("ds_grid_get_mean", 5);
        DefineFunction("ds_grid_get_disk_sum", 4);
        DefineFunction("ds_grid_get_disk_max", 4);
        DefineFunction("ds_grid_get_disk_min", 4);
        DefineFunction("ds_grid_get_disk_mean", 4);
        DefineFunction("ds_grid_value_exists", 6);
        DefineFunction("ds_grid_value_x", 6);
        DefineFunction("ds_grid_value_y", 6);
        DefineFunction("ds_grid_value_disk_exists", 5);
        DefineFunction("ds_grid_value_disk_x", 5);
        DefineFunction("ds_grid_value_disk_y", 5);
        DefineFunction("ds_grid_shuffle", 1);
        DefineFunction("ds_grid_write", 1);
        DefineFunction("ds_grid_read");
        DefineFunction("ds_grid_sort", 3);
        DefineFunction("ds_grid_set_pre", 4);
        DefineFunction("ds_grid_set_post", 4);
        DefineFunction("file_bin_open", 2);
        DefineFunction("file_bin_rewrite", 1);
        DefineFunction("file_bin_close", 1);
        DefineFunction("file_bin_position", 1);
        DefineFunction("file_bin_size", 1);
        DefineFunction("file_bin_seek", 2);
        DefineFunction("file_bin_read_byte", 1);
        DefineFunction("file_bin_write_byte", 2);
        DefineFunction("file_text_open_from_string", 1);
        DefineFunction("file_text_open_read", 1);
        DefineFunction("file_text_open_write", 1);
        DefineFunction("file_text_open_append", 1);
        DefineFunction("file_text_close", 1);
        DefineFunction("file_text_read_string", 1);
        DefineFunction("file_text_read_real", 1);
        DefineFunction("file_text_readln", 1);
        DefineFunction("file_text_eof", 1);
        DefineFunction("file_text_eoln", 1);
        DefineFunction("file_text_write_string", 2);
        DefineFunction("file_text_write_real", 2);
        DefineFunction("file_text_writeln", 1);
        DefineFunction("file_open_read", 1);
        DefineFunction("file_open_write", 1);
        DefineFunction("file_open_append", 1);
        DefineFunction("file_close", 0);
        DefineFunction("file_read_string", 0);
        DefineFunction("file_read_real", 0);
        DefineFunction("file_readln", 0);
        DefineFunction("file_eof", 0);
        DefineFunction("file_write_string", 1);
        DefineFunction("file_write_real", 1);
        DefineFunction("file_writeln", 0);
        DefineFunction("file_exists", 1);
        DefineFunction("file_delete", 1);
        DefineFunction("file_rename", 2);
        DefineFunction("file_copy", 2);
        DefineFunction("directory_exists", 1);
        DefineFunction("directory_create", 1);
        DefineFunction("directory_destroy", 1);
        DefineFunction("file_find_first", 2);
        DefineFunction("file_find_next", 0);
        DefineFunction("file_find_close", 0);
        DefineFunction("file_attributes", 2);
        DefineFunction("filename_name", 1);
        DefineFunction("filename_path", 1);
        DefineFunction("filename_dir", 1);
        DefineFunction("filename_drive", 1);
        DefineFunction("filename_ext", 1);
        DefineFunction("filename_change_ext", 2);
        DefineFunction("parameter_count", 0);
        DefineFunction("parameter_string", 1);
        DefineFunction("environment_get_variable", 1);
        DefineFunction("ini_open_from_string", 1);
        DefineFunction("ini_open", 1);
        DefineFunction("ini_close", 0);
        DefineFunction("ini_read_string", 3);
        DefineFunction("ini_read_real", 3);
        DefineFunction("ini_write_string", 3);
        DefineFunction("ini_write_real", 3);
        DefineFunction("ini_key_exists", 2);
        DefineFunction("ini_section_exists", 1);
        DefineFunction("ini_key_delete", 2);
        DefineFunction("ini_section_delete", 1);
        DefineFunction("http_post_string", 2);
        DefineFunction("http_get", 1);
        DefineFunction("http_get_file", 2);
        DefineFunction("http_request", 4);
        DefineFunction("json_encode", 1);
        DefineFunction("json_decode", 1);
        DefineFunction("zip_unzip", 2);
        DefineFunction("load_csv", 1);
        DefineFunction("move_random", 2);
        DefineFunction("place_free", 2);
        DefineFunction("place_empty");
        DefineFunction("place_meeting", 3);
        DefineFunction("place_snapped", 2);
        DefineFunction("move_snap", 2);
        DefineFunction("move_towards_point", 3);
        DefineFunction("move_contact", 1);
        DefineFunction("move_contact_solid", 2);
        DefineFunction("move_contact_all", 2);
        DefineFunction("move_outside_solid", 2);
        DefineFunction("move_outside_all", 2);
        DefineFunction("move_bounce", 1);
        DefineFunction("move_bounce_solid", 1);
        DefineFunction("move_bounce_all", 1);
        DefineFunction("move_wrap", 3);
        DefineFunction("motion_set", 2);
        DefineFunction("motion_add", 2);
        DefineFunction("distance_to_point", 2);
        DefineFunction("distance_to_object", 1);
        DefineFunction("path_start", 4);
        DefineFunction("path_end", 0);
        DefineFunction("mp_linear_step", 4);
        DefineFunction("mp_linear_path", 5);
        DefineFunction("mp_linear_step_object", 4);
        DefineFunction("mp_linear_path_object", 5);
        DefineFunction("mp_potential_settings", 4);
        DefineFunction("mp_potential_step", 4);
        DefineFunction("mp_potential_path", 6);
        DefineFunction("mp_potential_step_object", 4);
        DefineFunction("mp_potential_path_object", 6);
        DefineFunction("mp_grid_create", 6);
        DefineFunction("mp_grid_destroy", 1);
        DefineFunction("mp_grid_clear_all", 1);
        DefineFunction("mp_grid_clear_cell", 3);
        DefineFunction("mp_grid_clear_rectangle", 5);
        DefineFunction("mp_grid_add_cell", 3);
        DefineFunction("mp_grid_get_cell", 3);
        DefineFunction("mp_grid_add_rectangle", 5);
        DefineFunction("mp_grid_add_instances", 3);
        DefineFunction("mp_grid_path", 7);
        DefineFunction("mp_grid_draw", 1);
        DefineFunction("mp_grid_to_ds_grid", 2);
        DefineFunction("collision_point", 5);
        DefineFunction("collision_point_list", 7);
        DefineFunction("collision_rectangle", 7);
        DefineFunction("collision_rectangle_list", 9);
        DefineFunction("collision_circle", 6);
        DefineFunction("collision_circle_list", 8);
        DefineFunction("collision_ellipse", 7);
        DefineFunction("collision_ellipse_list", 9);
        DefineFunction("collision_line", 7);
        DefineFunction("collision_line_list", 9);
        DefineFunction("collision_shape", 9);
        DefineFunction("point_in_rectangle", 6);
        DefineFunction("point_in_triangle", 8);
        DefineFunction("point_in_circle", 5);
        DefineFunction("rectangle_in_rectangle", 8);
        DefineFunction("rectangle_in_triangle", 10);
        DefineFunction("rectangle_in_circle", 7);
        DefineFunction("instance_find", 2);
        DefineFunction("instance_exists", 1);
        DefineFunction("instance_number", 1);
        DefineFunction("instance_position", 3);
        DefineFunction("instance_position_list", 5);
        DefineFunction("instance_nearest", 3);
        DefineFunction("instance_furthest", 3);
        DefineFunction("instance_place", 3);
        DefineFunction("instance_place_list", 5);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("instance_create", 3);
        }
        DefineFunction("instance_create_depth", 4);
        DefineFunction("instance_create_layer", 4);
        DefineFunction("instance_copy", 1);
        DefineFunction("instance_change", 2);
        DefineFunction("instance_destroy");
        DefineFunction("instance_sprite", 1);
        DefineFunction("position_empty", 2);
        DefineFunction("position_meeting", 3);
        DefineFunction("position_destroy", 2);
        DefineFunction("position_change", 4);
        DefineFunction("instance_id_get", 1);
        DefineFunction("instance_deactivate_all", 1);
        DefineFunction("instance_deactivate_object", 1);
        DefineFunction("instance_deactivate_region", 6);
        DefineFunction("instance_deactivate_region_special", 8);
        DefineFunction("instance_deactivate_layer", 1);
        DefineFunction("instance_activate_all", 0);
        DefineFunction("instance_activate_object", 1);
        DefineFunction("instance_activate_region", 5);
        DefineFunction("instance_activate_layer", 1);
        DefineFunction("room_goto", 1);
        DefineFunction("room_goto_previous", 0);
        DefineFunction("room_goto_next", 0);
        DefineFunction("room_previous", 1);
        DefineFunction("room_next", 1);
        DefineFunction("room_restart", 0);
        DefineFunction("game_end", 0);
        DefineFunction("game_restart", 0);
        DefineFunction("game_load", 1);
        DefineFunction("game_save", 1);
        DefineFunction("game_save_buffer", 1);
        DefineFunction("game_load_buffer", 1);
        DefineFunction("display_get_width", 0);
        DefineFunction("display_get_height", 0);
        DefineFunction("display_get_orientation", 0);
        DefineFunction("display_get_gui_width", 0);
        DefineFunction("display_get_gui_height", 0);
        DefineFunction("display_reset", 2);
        DefineFunction("display_mouse_get_x", 0);
        DefineFunction("display_mouse_get_y", 0);
        DefineFunction("display_mouse_set", 2);
        DefineFunction("draw_enable_drawevent", 1);
        DefineFunction("device_mouse_x_to_gui", 1);
        DefineFunction("device_mouse_y_to_gui", 1);
        DefineFunction("display_get_windows_vertex_buffer_method", 0);
        DefineFunction("display_get_windows_alternate_sync", 0);
        DefineFunction("display_set_windows_vertex_buffer_method", 1);
        DefineFunction("display_set_windows_alternate_sync", 1);
        DefineFunction("display_set_ui_visibility", 1);
        DefineFunction("display_set_timing_method", 1);
        DefineFunction("display_get_timing_method", 0);
        DefineFunction("display_set_sleep_margin", 1);
        DefineFunction("display_get_sleep_margin", 0);
        DefineFunction("window_set_fullscreen", 1);
        DefineFunction("window_get_fullscreen", 0);
        DefineFunction("window_set_caption", 1);
        DefineFunction("window_get_caption", 0);
        DefineFunction("window_set_cursor", 1);
        DefineFunction("window_get_cursor", 0);
        DefineFunction("window_set_color", 1);
        DefineFunction("window_get_color", 0);
        DefineFunction("window_set_colour", 1);
        DefineFunction("window_get_colour", 0);
        DefineFunction("window_set_min_width", 1);
        DefineFunction("window_set_max_width", 1);
        DefineFunction("window_set_min_height", 1);
        DefineFunction("window_set_max_height", 1);
        DefineFunction("window_set_position", 2);
        DefineFunction("window_set_size", 2);
        DefineFunction("window_set_rectangle", 4);
        DefineFunction("window_center", 0);
        DefineFunction("window_get_x", 0);
        DefineFunction("window_get_y", 0);
        DefineFunction("window_get_width", 0);
        DefineFunction("window_get_height", 0);
        DefineFunction("window_mouse_get_x", 0);
        DefineFunction("window_mouse_get_y", 0);
        DefineFunction("window_mouse_set", 2);
        DefineFunction("window_view_mouse_get_x", 1);
        DefineFunction("window_view_mouse_get_y", 1);
        DefineFunction("window_views_mouse_get_x", 0);
        DefineFunction("window_views_mouse_get_y", 0);
        DefineFunction("window_get_visible_rects", 4);
        DefineFunction("screen_save", 1);
        DefineFunction("screen_save_part", 5);
        DefineFunction("draw_getpixel", 2);
        DefineFunction("draw_getpixel_ext", 2);
        DefineFunction("draw_set_color", 1);
        DefineFunction("draw_set_colour", 1);
        DefineFunction("draw_set_alpha", 1);
        DefineFunction("draw_get_color", 0);
        DefineFunction("draw_get_colour", 0);
        DefineFunction("draw_get_alpha", 0);
        DefineFunction("merge_color", 3);
        DefineFunction("make_color", 3);
        DefineFunction("make_color_rgb", 3);
        DefineFunction("make_color_hsv", 3);
        DefineFunction("color_get_red", 1);
        DefineFunction("color_get_green", 1);
        DefineFunction("color_get_blue", 1);
        DefineFunction("color_get_hue", 1);
        DefineFunction("color_get_saturation", 1);
        DefineFunction("color_get_value", 1);
        DefineFunction("merge_colour", 3);
        DefineFunction("make_colour", 3);
        DefineFunction("make_colour_rgb", 3);
        DefineFunction("make_colour_hsv", 3);
        DefineFunction("colour_get_red", 1);
        DefineFunction("colour_get_green", 1);
        DefineFunction("colour_get_blue", 1);
        DefineFunction("colour_get_hue", 1);
        DefineFunction("colour_get_saturation", 1);
        DefineFunction("colour_get_value", 1);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("draw_set_blend_mode", 1);
            DefineFunction("draw_set_blend_mode_ext", 2);
            DefineFunction("draw_set_color_write_enable", 4);
            DefineFunction("draw_set_colour_write_enable", 4);
            DefineFunction("draw_set_alpha_test", 1);
            DefineFunction("draw_set_alpha_test_ref_value", 1);
            DefineFunction("draw_get_alpha_test", 0);
            DefineFunction("draw_get_alpha_test_ref_value", 0);
        }
        DefineFunction("draw_clear", 1);
        DefineFunction("draw_clear_alpha", 2);
        DefineFunction("draw_point", 2);
        DefineFunction("draw_line", 4);
        DefineFunction("draw_line_width", 5);
        DefineFunction("draw_rectangle", 5);
        DefineFunction("draw_roundrect", 5);
        DefineFunction("draw_roundrect_ext", 7);
        DefineFunction("draw_triangle", 7);
        DefineFunction("draw_circle", 4);
        DefineFunction("draw_ellipse", 5);
        DefineFunction("draw_arrow", 5);
        DefineFunction("draw_button", 5);
        DefineFunction("draw_healthbar", 11);
        DefineFunction("draw_path", 4);
        DefineFunction("draw_point_color", 3);
        DefineFunction("draw_line_color", 6);
        DefineFunction("draw_line_width_color", 7);
        DefineFunction("draw_rectangle_color", 9);
        DefineFunction("draw_roundrect_color", 7);
        DefineFunction("draw_roundrect_color_ext", 9);
        DefineFunction("draw_triangle_color", 10);
        DefineFunction("draw_circle_color", 6);
        DefineFunction("draw_ellipse_color", 7);
        DefineFunction("draw_point_colour", 3);
        DefineFunction("draw_line_colour", 6);
        DefineFunction("draw_line_width_colour", 7);
        DefineFunction("draw_rectangle_colour", 9);
        DefineFunction("draw_roundrect_colour", 7);
        DefineFunction("draw_roundrect_colour_ext", 9);
        DefineFunction("draw_triangle_colour", 10);
        DefineFunction("draw_circle_colour", 6);
        DefineFunction("draw_ellipse_colour", 7);
        DefineFunction("draw_set_circle_precision", 1);
        DefineFunction("draw_primitive_begin", 1);
        DefineFunction("draw_primitive_begin_texture", 2);
        DefineFunction("draw_primitive_end", 0);
        DefineFunction("draw_vertex", 2);
        DefineFunction("draw_vertex_color", 4);
        DefineFunction("draw_vertex_colour", 4);
        DefineFunction("draw_vertex_texture", 4);
        DefineFunction("draw_vertex_texture_color", 6);
        DefineFunction("draw_vertex_texture_colour", 6);
        DefineFunction("sprite_get_uvs", 2);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("background_get_uvs", 1);
            DefineFunction("background_get_texture", 1);
            DefineFunction("texture_set_interpolation", 1);
            DefineFunction("texture_set_interpolation_ext", 2);
            DefineFunction("texture_set_blending", 1);
            DefineFunction("texture_set_repeat", 1);
            DefineFunction("texture_set_repeat_ext", 2);
        }
        DefineFunction("font_get_uvs", 1);
        DefineFunction("sprite_get_texture", 2);
        DefineFunction("font_get_texture", 1);
        DefineFunction("texture_exists", 1);
        DefineFunction("texture_get_width", 1);
        DefineFunction("texture_get_height", 1);
        DefineFunction("texture_global_scale", 1);
        DefineFunction("texture_get_uvs", 1);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("texture_prefetch", 1);
            DefineFunction("texture_flush", 1);
            DefineFunction("texture_debug_messages", 1);
            DefineFunction("texture_is_ready", 1);
            DefineFunction("texturegroup_get_textures", 1);
            DefineFunction("texturegroup_get_sprites", 1);
            DefineFunction("texturegroup_get_fonts", 1);
            DefineFunction("texturegroup_get_tilesets", 1);
        }
        if (data?.GeneralInfo?.Major >= 2 || data?.GeneralInfo?.Minor >= 3) // Since 1.3?
        {
            DefineFunction("draw_enable_swf_aa", 1);
            DefineFunction("draw_set_swf_aa_level", 1);
            DefineFunction("draw_get_swf_aa_level", 0);
        }
        DefineFunction("draw_set_font", 1);
        DefineFunction("draw_set_halign", 1);
        DefineFunction("draw_set_valign", 1);
        DefineFunction("string_width", 1);
        DefineFunction("string_height", 1);
        DefineFunction("string_width_ext", 3);
        DefineFunction("string_height_ext", 3);
        DefineFunction("draw_text", 3);
        DefineFunction("draw_text_ext", 5);
        DefineFunction("draw_text_transformed", 6);
        DefineFunction("draw_text_ext_transformed", 8);
        DefineFunction("draw_text_color", 8);
        DefineFunction("draw_text_transformed_color", 11);
        DefineFunction("draw_text_ext_color", 10);
        DefineFunction("draw_text_ext_transformed_color", 13);
        DefineFunction("draw_text_colour", 8);
        DefineFunction("draw_text_transformed_colour", 11);
        DefineFunction("draw_text_ext_colour", 10);
        DefineFunction("draw_text_ext_transformed_colour", 13);
        DefineFunction("shader_enable_corner_id", 1);
        DefineFunction("draw_self", 0);
        DefineFunction("draw_sprite", 4);
        DefineFunction("draw_sprite_pos", 11);
        DefineFunction("draw_shape", 12);
        DefineFunction("draw_shape_string", 11);
        DefineFunction("draw_sprite_ext", 9);
        DefineFunction("draw_sprite_stretched", 6);
        DefineFunction("draw_sprite_stretched_ext", 8);
        DefineFunction("draw_sprite_part", 8);
        DefineFunction("draw_sprite_part_ext", 12);
        DefineFunction("draw_sprite_general", 16);
        DefineFunction("draw_sprite_tiled", 4);
        DefineFunction("draw_sprite_tiled_ext", 8);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("draw_background", 3);
            DefineFunction("draw_background_ext", 8);
            DefineFunction("draw_background_stretched", 5);
            DefineFunction("draw_background_stretched_ext", 7);
            DefineFunction("draw_background_part", 7);
            DefineFunction("draw_background_part_ext", 11);
            DefineFunction("draw_background_general", 15);
            DefineFunction("draw_background_tiled", 3);
            DefineFunction("draw_background_tiled_ext", 7);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("tile_get_x", 1);
            DefineFunction("tile_get_y", 1);
            DefineFunction("tile_get_left", 1);
            DefineFunction("tile_get_top", 1);
            DefineFunction("tile_get_width", 1);
            DefineFunction("tile_get_height", 1);
            DefineFunction("tile_get_depth", 1);
            DefineFunction("tile_get_visible", 1);
            DefineFunction("tile_get_xscale", 1);
            DefineFunction("tile_get_yscale", 1);
            DefineFunction("tile_get_blend", 1);
            DefineFunction("tile_get_alpha", 1);
            DefineFunction("tile_get_background", 1);
            DefineFunction("tile_set_visible", 2);
            DefineFunction("tile_set_background", 2);
            DefineFunction("tile_set_region", 5);
            DefineFunction("tile_set_position", 3);
            DefineFunction("tile_set_depth", 2);
            DefineFunction("tile_set_scale", 3);
            DefineFunction("tile_set_blend", 2);
            DefineFunction("tile_set_alpha", 2);
            DefineFunction("tile_add", 8);
            DefineFunction("tile_get_count", 0);
            DefineFunction("tile_get_id", 1);
            DefineFunction("tile_get_ids", 0);
            DefineFunction("tile_get_ids_at_depth", 1);
            DefineFunction("tile_find", 3);
            DefineFunction("tile_exists", 1);
            DefineFunction("tile_delete", 1);
            DefineFunction("tile_delete_at", 3);
            DefineFunction("tile_layer_hide", 1);
            DefineFunction("tile_layer_show", 1);
            DefineFunction("tile_layer_delete", 1);
            DefineFunction("tile_layer_shift", 3);
            DefineFunction("tile_layer_find", 3);
            DefineFunction("tile_layer_delete_at", 3);
            DefineFunction("tile_layer_depth", 2);
        }
        DefineFunction("surface_create", 2);
        DefineFunction("surface_create_ext", 3);
        DefineFunction("surface_create_special", 3);
        DefineFunction("surface_resize", 3);
        DefineFunction("surface_free", 1);
        DefineFunction("surface_exists", 1);
        DefineFunction("surface_get_width", 1);
        DefineFunction("surface_get_height", 1);
        DefineFunction("surface_get_texture", 1);
        DefineFunction("surface_set_target", 1);
        DefineFunction("surface_set_target_ext", 2);
        DefineFunction("surface_reset_target", 0);
        DefineFunction("surface_depth_disable", 1);
        DefineFunction("surface_get_depth_disable", 0);
        DefineFunction("draw_surface", 3);
        DefineFunction("draw_surface_ext", 8);
        DefineFunction("draw_surface_stretched", 5);
        DefineFunction("draw_surface_stretched_ext", 7);
        DefineFunction("draw_surface_part", 7);
        DefineFunction("draw_surface_part_ext", 11);
        DefineFunction("draw_surface_general", 15);
        DefineFunction("draw_surface_tiled", 3);
        DefineFunction("draw_surface_tiled_ext", 7);
        DefineFunction("surface_save", 2);
        DefineFunction("surface_save_part", 6);
        DefineFunction("surface_getpixel", 3);
        DefineFunction("surface_getpixel_ext", 3);
        DefineFunction("surface_copy", 4);
        DefineFunction("surface_copy_part", 8);
        DefineFunction("application_surface_draw_enable", 1);
        DefineFunction("application_get_position", 0);
        DefineFunction("application_surface_enable", 1);
        DefineFunction("application_surface_is_enabled", 0);
        DefineFunction("show_message", 1);
        DefineFunction("show_question", 1);
        DefineFunction("show_message_async", 1);
        DefineFunction("show_question_async", 1);
        DefineFunction("show_error", 2);
        DefineFunction("highscore_clear", 0);
        DefineFunction("highscore_add", 2);
        DefineFunction("highscore_value", 1);
        DefineFunction("highscore_name", 1);
        DefineFunction("draw_highscore", 4);
        DefineFunction("clickable_add", 6);
        DefineFunction("clickable_add_ext", 8);
        DefineFunction("clickable_change", 4);
        DefineFunction("clickable_change_ext", 6);
        DefineFunction("clickable_delete", 1);
        DefineFunction("clickable_exists", 1);
        DefineFunction("clickable_set_style", 2);
        DefineFunction("get_integer", 2);
        DefineFunction("get_string", 2);
        DefineFunction("get_integer_async", 2);
        DefineFunction("get_string_async", 2);
        DefineFunction("get_login_async", 2);
        DefineFunction("get_color", 1);
        DefineFunction("get_open_filename", 2);
        DefineFunction("get_save_filename", 2);
        DefineFunction("get_open_filename_ext", 4);
        DefineFunction("get_save_filename_ext", 4);
        DefineFunction("keyboard_get_numlock", 0);
        DefineFunction("keyboard_set_numlock", 1);
        DefineFunction("keyboard_key_press", 1);
        DefineFunction("keyboard_key_release", 1);
        DefineFunction("keyboard_set_map", 2);
        DefineFunction("keyboard_get_map", 1);
        DefineFunction("keyboard_unset_map", 0);
        DefineFunction("keyboard_check", 1);
        DefineFunction("keyboard_check_pressed", 1);
        DefineFunction("keyboard_check_released", 1);
        DefineFunction("keyboard_check_direct", 1);
        DefineFunction("mouse_check_button", 1);
        DefineFunction("mouse_check_button_pressed", 1);
        DefineFunction("mouse_check_button_released", 1);
        DefineFunction("mouse_wheel_up", 0);
        DefineFunction("mouse_wheel_down", 0);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("keyboard_virtual_show", 4);
            DefineFunction("keyboard_virtual_hide", 0);
            DefineFunction("keyboard_virtual_status", 0);
            DefineFunction("keyboard_virtual_height", 0);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("joystick_exists", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_direction", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_name", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_axes", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_buttons", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_has_pov", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_check_button", 2, FunctionClassification.Joystick);
            DefineFunction("joystick_xpos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_ypos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_zpos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_rpos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_upos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_vpos", 1, FunctionClassification.Joystick);
            DefineFunction("joystick_pov", 1, FunctionClassification.Joystick);
        }
        DefineFunction("keyboard_clear", 1);
        DefineFunction("mouse_clear", 1);
        DefineFunction("io_clear", 0);
        DefineFunction("device_mouse_dbclick_enable", 1);
        DefineFunction("gpio_set", 2);
        DefineFunction("gpio_clear", 1);
        DefineFunction("gpio_get", 1);
        DefineFunction("gpio_set_mode", 2);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("gesture_drag_time", 1);
            DefineFunction("gesture_drag_distance", 1);
            DefineFunction("gesture_flick_speed", 1);
            DefineFunction("gesture_double_tap_time", 1);
            DefineFunction("gesture_double_tap_distance", 1);
            DefineFunction("gesture_pinch_distance", 1);
            DefineFunction("gesture_pinch_angle_towards", 1);
            DefineFunction("gesture_pinch_angle_away", 1);
            DefineFunction("gesture_rotate_time", 1);
            DefineFunction("gesture_rotate_angle", 1);
            DefineFunction("gesture_tap_count", 1);
            DefineFunction("gesture_get_drag_time", 0);
            DefineFunction("gesture_get_drag_distance", 0);
            DefineFunction("gesture_get_flick_speed", 0);
            DefineFunction("gesture_get_double_tap_time", 0);
            DefineFunction("gesture_get_double_tap_distance", 0);
            DefineFunction("gesture_get_pinch_distance", 0);
            DefineFunction("gesture_get_pinch_angle_towards", 0);
            DefineFunction("gesture_get_pinch_angle_away", 0);
            DefineFunction("gesture_get_rotate_time", 0);
            DefineFunction("gesture_get_rotate_angle", 0);
            DefineFunction("gesture_get_tap_count", 0);
        }
        DefineFunction("is_bool", 1);
        DefineFunction("is_real", 1);
        DefineFunction("is_string", 1);
        DefineFunction("is_array", 1);
        DefineFunction("is_undefined", 1);
        DefineFunction("is_int32", 1);
        DefineFunction("is_int64", 1);
        DefineFunction("is_ptr", 1);
        DefineFunction("is_vec3", 1);
        DefineFunction("is_vec4", 1);
        DefineFunction("is_matrix", 1);
        if (data?.IsVersionAtLeast(2, 3) == true)
        {
            DefineFunction("is_numeric", 1);
            DefineFunction("is_nan", 1);
            DefineFunction("is_infinity", 1);
            DefineFunction("is_struct", 1);
            DefineFunction("is_method", 1);
            DefineFunction("is_instanceof", 2);
            DefineFunction("is_callable", 1);
            DefineFunction("is_handle", 1);
        }
        DefineFunction("array_length_1d", 1);
        DefineFunction("array_length_2d", 2);
        DefineFunction("array_height_2d", 1);
        DefineFunction("array_set", 3);
        DefineFunction("array_set_pre", 3);
        DefineFunction("array_set_post", 3);
        DefineFunction("array_get", 2);
        DefineFunction("array_set_2D", 4);
        DefineFunction("array_set_2D_pre", 4);
        DefineFunction("array_set_2D_post", 4);
        DefineFunction("array_get_2D", 3);
        DefineFunction("array_equals", 2);
        DefineFunction("array_create");
        DefineFunction("array_copy", 5);
        if (data?.IsVersionAtLeast(2, 3) == true)
        {
            DefineFunction("array_length", 1);
            DefineFunction("array_resize", 2);
            DefineFunction("array_push");
            DefineFunction("array_pop", 1);
            DefineFunction("array_shift", 1);
            DefineFunction("array_insert");
            DefineFunction("array_delete", 3);
            DefineFunction("array_sort", 2);
            DefineFunction("array_shuffle", 1);
            DefineFunction("array_shuffle_ext", 1);
            DefineFunction("array_get_index", 2);
            DefineFunction("array_contains", 2);
            DefineFunction("array_contains_ext", 3);
            DefineFunction("array_first", 1);
            DefineFunction("array_last", 1);
            DefineFunction("array_create_ext", 2);
            DefineFunction("array_find_index", 2);
            DefineFunction("array_any", 2);
            DefineFunction("array_all", 2);
            DefineFunction("array_foreach", 2);
            DefineFunction("array_reduce", 2);
            DefineFunction("array_filter", 2);
            DefineFunction("array_filter_ext", 2);
            DefineFunction("array_map", 2);
            DefineFunction("array_map_ext", 2);
            DefineFunction("array_copy_while", 2);
            DefineFunction("array_unique", 1);
            DefineFunction("array_unique_ext", 1);
            DefineFunction("array_reverse", 1);
            DefineFunction("array_reverse_ext", 1);
            DefineFunction("array_concat");
            DefineFunction("array_union");
            DefineFunction("array_intersection");
            DefineFunction("method", 2);
            DefineFunction("method_get_self", 1);
            DefineFunction("method_get_index", 1);
            DefineFunction("static_set", 2);
            DefineFunction("instanceof", 1);
            DefineFunction("exception_unhandled_handler", 1);
        }
        DefineFunction("typeof", 1);
        DefineFunction("variable_global_exists", 1);
        DefineFunction("variable_global_get", 1);
        DefineFunction("variable_global_set", 2);
        DefineFunction("variable_instance_exists", 2);
        DefineFunction("variable_instance_get", 2);
        DefineFunction("variable_instance_set", 3);
        DefineFunction("variable_instance_get_names", 1);
        if (data?.IsVersionAtLeast(2, 3) == true)
        {
            DefineFunction("variable_instance_names_count", 1);
            DefineFunction("variable_struct_exists", 2);
            DefineFunction("variable_struct_get", 2);
            DefineFunction("variable_struct_set", 3);
            DefineFunction("variable_struct_get_names", 1);
            DefineFunction("variable_struct_names_count", 1);
            DefineFunction("variable_struct_remove", 2);
            DefineFunction("variable_get_hash", 1);
            DefineFunction("variable_clone", 1);
            DefineFunction("json_stringify", 1);
            DefineFunction("json_parse", 1);
        }
        DefineFunction("random", 1);
        DefineFunction("random_range", 2);
        DefineFunction("irandom", 1);
        DefineFunction("irandom_range", 2);
        DefineFunction("random_set_seed", 1);
        DefineFunction("random_get_seed", 0);
        DefineFunction("randomize", 0);
        DefineFunction("randomise", 0);
        DefineFunction("random_use_old_version", 1);
        DefineFunction("abs", 1);
        DefineFunction("round", 1);
        DefineFunction("floor", 1);
        DefineFunction("ceil", 1);
        DefineFunction("sign", 1);
        DefineFunction("frac", 1);
        DefineFunction("sqrt", 1);
        DefineFunction("sqr", 1);
        DefineFunction("exp", 1);
        DefineFunction("ln", 1);
        DefineFunction("log2", 1);
        DefineFunction("log10", 1);
        DefineFunction("sin", 1);
        DefineFunction("cos", 1);
        DefineFunction("tan", 1);
        DefineFunction("arcsin", 1);
        DefineFunction("arccos", 1);
        DefineFunction("arctan", 1);
        DefineFunction("arctan2", 2);
        DefineFunction("dsin", 1);
        DefineFunction("dcos", 1);
        DefineFunction("dtan", 1);
        DefineFunction("darcsin", 1);
        DefineFunction("darccos", 1);
        DefineFunction("darctan", 1);
        DefineFunction("darctan2", 2);
        DefineFunction("degtorad", 1);
        DefineFunction("radtodeg", 1);
        DefineFunction("power", 2);
        DefineFunction("logn", 2);
        DefineFunction("min");
        DefineFunction("max");
        DefineFunction("min3", 3);
        DefineFunction("max3", 3);
        DefineFunction("mean");
        DefineFunction("median");
        DefineFunction("choose");
        DefineFunction("clamp", 3);
        DefineFunction("lerp", 3);
        DefineFunction("dot_product", 4);
        DefineFunction("dot_product_3d", 6);
        DefineFunction("dot_product_normalised", 4);
        DefineFunction("dot_product_3d_normalised", 6);
        DefineFunction("dot_product_normalized", 4);
        DefineFunction("dot_product_3d_normalized", 6);
        DefineFunction("math_set_epsilon", 1);
        DefineFunction("math_get_epsilon", 0);
        DefineFunction("angle_difference", 2);
        DefineFunction("real", 1);
        DefineFunction("bool", 1);
        DefineFunction("string", 1);
        DefineFunction("int64", 1);
        DefineFunction("ptr", 1);
        DefineFunction("string_format", 3);
        DefineFunction("chr", 1);
        DefineFunction("ansi_char", 1);
        DefineFunction("ord", 1);
        DefineFunction("string_length", 1);
        DefineFunction("string_byte_length", 1);
        DefineFunction("string_pos", 2);
        DefineFunction("string_copy", 3);
        DefineFunction("string_char_at", 2);
        DefineFunction("string_ord_at", 2);
        DefineFunction("string_byte_at", 2);
        DefineFunction("string_set_byte_at", 3);
        DefineFunction("string_delete", 3);
        DefineFunction("string_insert", 3);
        DefineFunction("string_lower", 1);
        DefineFunction("string_upper", 1);
        DefineFunction("string_repeat", 2);
        DefineFunction("string_letters", 1);
        DefineFunction("string_digits", 1);
        DefineFunction("string_lettersdigits", 1);
        DefineFunction("string_replace", 3);
        DefineFunction("string_replace_all", 3);
        DefineFunction("string_count", 2);
        DefineFunction("string_hash_to_newline", 1);
        if (data?.IsVersionAtLeast(2, 3) == true)
        {
            DefineFunction("string_pos_ext", 3);
            DefineFunction("string_last_pos", 2);
            DefineFunction("string_last_pos_ext", 3);
            DefineFunction("string_ext", 2);
            DefineFunction("string_trim_start", 1);
            DefineFunction("string_trim_end", 1);
            DefineFunction("string_trim", 1);
            DefineFunction("string_starts_with", 2);
            DefineFunction("string_ends_with", 2);
            DefineFunction("string_split", 2);
            DefineFunction("string_split_ext", 2);
            DefineFunction("string_join");
            DefineFunction("string_join_ext", 2);
            DefineFunction("string_concat");
            DefineFunction("string_concat_ext", 1);
            DefineFunction("string_foreach", 2);

        }
        DefineFunction("point_distance", 4);
        DefineFunction("point_distance_3d", 6);
        DefineFunction("point_direction", 4);
        DefineFunction("lengthdir_x", 2);
        DefineFunction("lengthdir_y", 2);
        DefineFunction("event_inherited", 0);
        DefineFunction("event_perform", 2);
        DefineFunction("event_user", 1);
        DefineFunction("event_perform_object", 3);
        DefineFunction("external_define");
        DefineFunction("external_call");
        DefineFunction("external_free", 1);
        DefineFunction("external_define0", 3);
        DefineFunction("external_call0", 1);
        DefineFunction("external_define1", 4);
        DefineFunction("external_call1", 2);
        DefineFunction("external_define2", 5);
        DefineFunction("external_call2", 3);
        DefineFunction("external_define3", 6);
        DefineFunction("external_call3", 4);
        DefineFunction("external_define4", 7);
        DefineFunction("external_call4", 5);
        DefineFunction("external_define5", 3);
        DefineFunction("external_call5", 6);
        DefineFunction("external_define6", 3);
        DefineFunction("external_call6", 7);
        DefineFunction("external_define7", 3);
        DefineFunction("external_call7", 8);
        DefineFunction("external_define8", 3);
        DefineFunction("external_call8", 9);
        DefineFunction("window_handle", 0);
        DefineFunction("window_device", 0);
        DefineFunction("logical_xor", 2);
        DefineFunction("debug_get_callstack");
        DefineFunction("show_debug_message", 1);
        DefineFunction("show_debug_overlay", 1);
        DefineFunction("debug_event", 1);
        DefineFunction("alarm_get", 1);
        DefineFunction("alarm_set", 2);
        DefineFunction("clipboard_has_text", 0);
        DefineFunction("clipboard_set_text", 1);
        DefineFunction("clipboard_get_text", 0);
        DefineFunction("date_current_datetime", 0);
        DefineFunction("date_create_datetime", 6);
        DefineFunction("date_valid_datetime", 6);
        DefineFunction("date_inc_year", 2);
        DefineFunction("date_inc_month", 2);
        DefineFunction("date_inc_week", 2);
        DefineFunction("date_inc_day", 2);
        DefineFunction("date_inc_hour", 2);
        DefineFunction("date_inc_minute", 2);
        DefineFunction("date_inc_second", 2);
        DefineFunction("date_get_year", 1);
        DefineFunction("date_get_month", 1);
        DefineFunction("date_get_week", 1);
        DefineFunction("date_get_day", 1);
        DefineFunction("date_get_hour", 1);
        DefineFunction("date_get_minute", 1);
        DefineFunction("date_get_second", 1);
        DefineFunction("date_get_weekday", 1);
        DefineFunction("date_get_day_of_year", 1);
        DefineFunction("date_get_hour_of_year", 1);
        DefineFunction("date_get_minute_of_year", 1);
        DefineFunction("date_get_second_of_year", 1);
        DefineFunction("date_year_span", 2);
        DefineFunction("date_month_span", 2);
        DefineFunction("date_week_span", 2);
        DefineFunction("date_day_span", 2);
        DefineFunction("date_hour_span", 2);
        DefineFunction("date_minute_span", 2);
        DefineFunction("date_second_span", 2);
        DefineFunction("date_compare_datetime", 2);
        DefineFunction("date_compare_date", 2);
        DefineFunction("date_compare_time", 2);
        DefineFunction("date_date_of", 1);
        DefineFunction("date_time_of", 1);
        DefineFunction("date_datetime_string", 1);
        DefineFunction("date_date_string", 1);
        DefineFunction("date_time_string", 1);
        DefineFunction("date_days_in_month", 1);
        DefineFunction("date_days_in_year", 1);
        DefineFunction("date_leap_year", 1);
        DefineFunction("date_is_today", 1);
        DefineFunction("date_set_timezone", 1);
        DefineFunction("date_get_timezone", 0);
        DefineFunction("game_set_speed", 2);
        DefineFunction("game_get_speed", 1);
        DefineFunction("part_type_create", 0);
        DefineFunction("part_type_destroy", 1);
        DefineFunction("part_type_exists", 1);
        DefineFunction("part_type_clear", 1);
        DefineFunction("part_type_shape", 2);
        DefineFunction("part_type_sprite", 5);
        DefineFunction("part_type_size", 5);
        DefineFunction("part_type_scale", 3);
        DefineFunction("part_type_life", 3);
        DefineFunction("part_type_step", 3);
        DefineFunction("part_type_death", 3);
        DefineFunction("part_type_speed", 5);
        DefineFunction("part_type_direction", 5);
        DefineFunction("part_type_orientation", 6);
        DefineFunction("part_type_gravity", 3);
        DefineFunction("part_type_color_mix", 3);
        DefineFunction("part_type_color_rgb", 7);
        DefineFunction("part_type_color_hsv", 7);
        DefineFunction("part_type_color1", 2);
        DefineFunction("part_type_color2", 3);
        DefineFunction("part_type_color3", 4);
        DefineFunction("part_type_color", 4);
        DefineFunction("part_type_colour_mix", 3);
        DefineFunction("part_type_colour_rgb", 7);
        DefineFunction("part_type_colour_hsv", 7);
        DefineFunction("part_type_colour1", 2);
        DefineFunction("part_type_colour2", 3);
        DefineFunction("part_type_colour3", 4);
        DefineFunction("part_type_colour", 4);
        DefineFunction("part_type_alpha1", 2);
        DefineFunction("part_type_alpha2", 3);
        DefineFunction("part_type_alpha3", 4);
        DefineFunction("part_type_alpha", 4);
        DefineFunction("part_type_blend", 2);
        DefineFunction("part_system_create", 0);
        DefineFunction("part_system_destroy", 1);
        DefineFunction("part_system_exists", 1);
        DefineFunction("part_system_clear", 1);
        DefineFunction("part_system_draw_order", 2);
        DefineFunction("part_system_depth", 2);
        DefineFunction("part_system_position", 3);
        DefineFunction("part_system_automatic_update", 2);
        DefineFunction("part_system_automatic_draw", 2);
        DefineFunction("part_system_update", 1);
        DefineFunction("part_system_drawit", 1);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("part_system_create_layer", 2);
            DefineFunction("part_system_get_layer", 1);
            DefineFunction("part_system_layer", 2);
        }
        DefineFunction("part_particles_create", 5);
        DefineFunction("part_particles_create_color", 6);
        DefineFunction("part_particles_create_colour", 6);
        DefineFunction("part_particles_clear", 1);
        DefineFunction("part_particles_count", 1);
        DefineFunction("part_emitter_create", 1);
        DefineFunction("part_emitter_destroy", 2);
        DefineFunction("part_emitter_destroy_all", 1);
        DefineFunction("part_emitter_exists", 2);
        DefineFunction("part_emitter_clear", 2);
        DefineFunction("part_emitter_region", 8);
        DefineFunction("part_emitter_burst", 4);
        DefineFunction("part_emitter_stream", 4);
        DefineFunction("effect_create_below", 5);
        DefineFunction("effect_create_above", 5);
        DefineFunction("effect_clear", 0);
        DefineFunction("sprite_name", 1);
        DefineFunction("sprite_exists", 1);
        DefineFunction("sprite_get_name", 1);
        DefineFunction("sprite_get_number", 1);
        DefineFunction("sprite_get_width", 1);
        DefineFunction("sprite_get_height", 1);
        DefineFunction("sprite_get_transparent", 1);
        DefineFunction("sprite_get_smooth", 1);
        DefineFunction("sprite_get_preload", 1);
        DefineFunction("sprite_get_xoffset", 1);
        DefineFunction("sprite_get_yoffset", 1);
        DefineFunction("sprite_get_bbox_mode", 1);
        DefineFunction("sprite_get_bbox_left", 1);
        DefineFunction("sprite_get_bbox_right", 1);
        DefineFunction("sprite_get_bbox_top", 1);
        DefineFunction("sprite_get_bbox_bottom", 1);
        DefineFunction("sprite_get_precise", 1);
        DefineFunction("sprite_collision_mask", 9);
        DefineFunction("sprite_get_tpe", 2);
        DefineFunction("sprite_set_offset", 3);
        DefineFunction("sprite_set_bbox_mode", 2);
        DefineFunction("sprite_set_bbox", 5);
        DefineFunction("sprite_set_precise", 2);
        DefineFunction("sprite_set_alpha_from_sprite", 2);
        DefineFunction("sprite_add", 6);
        DefineFunction("sprite_replace", 7);
        DefineFunction("sprite_create_from_surface", 9);
        DefineFunction("sprite_add_from_surface", 8);
        DefineFunction("sprite_delete", 1);
        DefineFunction("sprite_duplicate", 1);
        DefineFunction("sprite_add_alpha", 6);
        DefineFunction("sprite_replace_alpha", 7);
        DefineFunction("sprite_assign", 2);
        DefineFunction("sprite_merge", 2);
        DefineFunction("sprite_save", 3);
        DefineFunction("sprite_save_strip", 2);
        DefineFunction("sprite_set_cache_size", 2);
        DefineFunction("sprite_set_cache_size_ext", 3);
        DefineFunction("font_set_cache_size", 2);
        DefineFunction("sprite_prefetch", 1);
        DefineFunction("sprite_prefetch_multi", 1);
        DefineFunction("sprite_flush", 1);
        DefineFunction("sprite_flush_multi", 1);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("sprite_set_speed", 3);
            DefineFunction("sprite_get_speed_type", 1);
            DefineFunction("sprite_get_speed", 1);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("background_name", 1);
            DefineFunction("background_exists", 1);
            DefineFunction("background_get_name", 1);
            DefineFunction("background_get_width", 1);
            DefineFunction("background_get_height", 1);
            DefineFunction("background_get_transparent", 1);
            DefineFunction("background_get_smooth", 1);
            DefineFunction("background_get_preload", 1);
            DefineFunction("background_set_alpha_from_background", 2);
            DefineFunction("background_create_from_surface", 7);
            DefineFunction("background_create_color", 3);
            DefineFunction("background_create_colour", 3);
            DefineFunction("background_create_gradient", 5);
            DefineFunction("background_add", 3);
            DefineFunction("background_replace", 4);
            DefineFunction("background_add_alpha", 2);
            DefineFunction("background_replace_alpha", 3);
            DefineFunction("background_delete", 1);
            DefineFunction("background_duplicate", 1);
            DefineFunction("background_assign", 2);
            DefineFunction("background_save", 2);
            DefineFunction("background_prefetch", 1);
            DefineFunction("background_prefetch_multi", 1);
            DefineFunction("background_flush", 1);
            DefineFunction("background_flush_multi", 1);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("sound_name", 1);
            DefineFunction("sound_exists", 1);
            DefineFunction("sound_get_name", 1);
            DefineFunction("sound_get_kind", 1);
            DefineFunction("sound_get_preload", 1);
            DefineFunction("sound_discard", 1);
            DefineFunction("sound_restore", 1);
            DefineFunction("sound_delete", 1);
        }
        DefineFunction("audio_listener_position", 3);
        DefineFunction("audio_listener_velocity", 3);
        DefineFunction("audio_listener_orientation", 6);
        DefineFunction("audio_emitter_position", 4);
        DefineFunction("audio_emitter_create", 0);
        DefineFunction("audio_emitter_exists", 1);
        DefineFunction("audio_emitter_free", 1);
        DefineFunction("audio_emitter_pitch", 2);
        DefineFunction("audio_emitter_velocity", 4);
        DefineFunction("audio_emitter_falloff", 4);
        DefineFunction("audio_emitter_gain", 2);
        DefineFunction("audio_play_sound", 3);
        DefineFunction("audio_play_sound_on", 4);
        DefineFunction("audio_play_sound_at", 9);
        DefineFunction("audio_stop_sound", 1);
        DefineFunction("audio_resume_sound", 1);
        DefineFunction("audio_pause_sound", 1);
        DefineFunction("audio_channel_num", 1);
        DefineFunction("audio_sound_length", 1);
        DefineFunction("audio_get_type", 1);
        DefineFunction("audio_falloff_set_model", 1);
        DefineFunction("audio_sound_get_listener_mask", 1);
        DefineFunction("audio_emitter_get_listener_mask", 1);
        DefineFunction("audio_get_listener_mask", 0);
        DefineFunction("audio_sound_set_listener_mask", 2);
        DefineFunction("audio_emitter_set_listener_mask", 2);
        DefineFunction("audio_set_listener_mask", 1);
        DefineFunction("audio_get_listener_count", 0);
        DefineFunction("audio_get_listener_info", 1);
        DefineFunction("audio_play_music", 2);
        DefineFunction("audio_stop_music", 0);
        DefineFunction("audio_master_gain", 1);
        DefineFunction("audio_music_gain", 2);
        DefineFunction("audio_sound_gain", 3);
        DefineFunction("audio_sound_pitch", 2);
        DefineFunction("audio_stop_all", 0);
        DefineFunction("audio_resume_all", 0);
        DefineFunction("audio_pause_all", 0);
        DefineFunction("audio_is_playing", 1);
        DefineFunction("audio_is_paused", 1);
        DefineFunction("audio_pause_music", 0);
        DefineFunction("audio_resume_music", 0);
        DefineFunction("audio_music_is_playing", 0);
        DefineFunction("audio_exists", 1);
        DefineFunction("audio_system", 0);
        DefineFunction("audio_emitter_get_gain", 1);
        DefineFunction("audio_emitter_get_pitch", 1);
        DefineFunction("audio_emitter_get_x", 1);
        DefineFunction("audio_emitter_get_y", 1);
        DefineFunction("audio_emitter_get_z", 1);
        DefineFunction("audio_emitter_get_vx", 1);
        DefineFunction("audio_emitter_get_vy", 1);
        DefineFunction("audio_emitter_get_vz", 1);
        DefineFunction("audio_listener_set_position", 4);
        DefineFunction("audio_listener_set_velocity", 4);
        DefineFunction("audio_listener_set_orientation", 7);
        DefineFunction("audio_listener_get_data", 1);
        DefineFunction("audio_set_master_gain", 2);
        DefineFunction("audio_get_master_gain", 1);
        DefineFunction("audio_sound_get_gain", 1);
        DefineFunction("audio_sound_get_pitch", 1);
        DefineFunction("audio_get_name", 1);
        DefineFunction("audio_sound_set_track_position", 2);
        DefineFunction("audio_sound_get_track_position", 1);
        DefineFunction("audio_group_load", 1);
        DefineFunction("audio_group_unload", 1);
        DefineFunction("audio_group_is_loaded", 1);
        DefineFunction("audio_group_load_progress", 1);
        DefineFunction("audio_group_name", 1);
        DefineFunction("audio_group_stop_all", 1);
        DefineFunction("audio_group_set_gain", 3);
        DefineFunction("audio_create_buffer_sound", 6);
        DefineFunction("audio_free_buffer_sound", 1);
        DefineFunction("audio_create_play_queue", 3);
        DefineFunction("audio_free_play_queue", 1);
        DefineFunction("audio_queue_sound", 4);
        DefineFunction("audio_create_stream", 1);
        DefineFunction("audio_destroy_stream", 1);
        DefineFunction("audio_start_recording", 1);
        DefineFunction("audio_stop_recording", 1);
        DefineFunction("audio_get_recorder_count", 0);
        DefineFunction("audio_get_recorder_info", 1);
        DefineFunction("audio_create_sync_group", 1);
        DefineFunction("audio_destroy_sync_group", 1);
        DefineFunction("audio_play_in_sync_group", 2);
        DefineFunction("audio_start_sync_group", 1);
        DefineFunction("audio_stop_sync_group", 1);
        DefineFunction("audio_pause_sync_group", 1);
        DefineFunction("audio_resume_sync_group", 1);
        DefineFunction("audio_sync_group_get_track_pos", 1);
        DefineFunction("audio_sync_group_debug", 1);
        DefineFunction("audio_sync_group_is_playing", 1);
        DefineFunction("audio_debug", 1);
        DefineFunction("audio_delete", 1);
        DefineFunction("font_name", 1);
        DefineFunction("font_exists", 1);
        DefineFunction("font_get_name", 1);
        DefineFunction("font_get_fontname", 1);
        DefineFunction("font_get_size", 1);
        DefineFunction("font_get_bold", 1);
        DefineFunction("font_get_italic", 1);
        DefineFunction("font_get_first", 1);
        DefineFunction("font_get_last", 1);
        DefineFunction("font_set_dynamic_texture_size", 1);
        DefineFunction("font_get_dynamic_texture_size", 0);
        DefineFunction("font_add_enable_aa", 1);
        DefineFunction("font_add_get_enable_aa", 0);
        DefineFunction("font_add", 6);
        DefineFunction("font_add_sprite", 4);
        DefineFunction("font_add_sprite_ext", 4);
        DefineFunction("font_replace_sprite", 5);
        DefineFunction("font_replace_sprite_ext", 5);
        DefineFunction("font_delete", 1);
        DefineFunction("script_exists", 1);
        DefineFunction("script_get_name", 1);
        DefineFunction("script_execute");
        DefineFunction("path_name", 1);
        DefineFunction("path_exists", 1);
        DefineFunction("path_get_name", 1);
        DefineFunction("path_get_length", 1);
        DefineFunction("path_get_time", 2);
        DefineFunction("path_get_kind", 1);
        DefineFunction("path_get_closed", 1);
        DefineFunction("path_get_precision", 1);
        DefineFunction("path_get_number", 1);
        DefineFunction("path_get_point_x", 2);
        DefineFunction("path_get_point_y", 2);
        DefineFunction("path_get_point_speed", 2);
        DefineFunction("path_get_x", 2);
        DefineFunction("path_get_y", 2);
        DefineFunction("path_get_speed", 2);
        DefineFunction("path_set_kind", 2);
        DefineFunction("path_set_closed", 2);
        DefineFunction("path_set_precision", 2);
        DefineFunction("path_add", 0);
        DefineFunction("path_duplicate", 1);
        DefineFunction("path_delete", 1);
        DefineFunction("path_assign", 2);
        DefineFunction("path_append", 2);
        DefineFunction("path_add_point", 4);
        DefineFunction("path_insert_point", 5);
        DefineFunction("path_change_point", 5);
        DefineFunction("path_delete_point", 2);
        DefineFunction("path_clear_points", 1);
        DefineFunction("path_reverse", 1);
        DefineFunction("path_mirror", 1);
        DefineFunction("path_flip", 1);
        DefineFunction("path_rotate", 2);
        DefineFunction("path_rescale", 3);
        DefineFunction("path_shift", 3);
        DefineFunction("timeline_name", 1);
        DefineFunction("timeline_exists", 1);
        DefineFunction("timeline_get_name", 1);
        DefineFunction("timeline_add", 0);
        DefineFunction("timeline_delete", 1);
        DefineFunction("timeline_clear", 1);
        DefineFunction("timeline_moment_clear", 2);
        DefineFunction("timeline_moment_add_script", 3);
        DefineFunction("timeline_size", 1);
        DefineFunction("timeline_max_moment", 1);
        DefineFunction("object_name", 1);
        DefineFunction("object_exists", 1);
        DefineFunction("object_get_name", 1);
        DefineFunction("object_get_sprite", 1);
        DefineFunction("object_get_solid", 1);
        DefineFunction("object_get_visible", 1);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("object_set_depth", 2);
            DefineFunction("object_get_depth", 1);
        }
        DefineFunction("object_get_persistent", 1);
        DefineFunction("object_get_mask", 1);
        DefineFunction("object_get_parent", 1);
        DefineFunction("object_get_physics", 1);
        DefineFunction("object_is_ancestor", 2);
        DefineFunction("object_set_sprite", 2);
        DefineFunction("object_set_solid", 2);
        DefineFunction("object_set_visible", 2);
        DefineFunction("object_set_persistent", 2);
        DefineFunction("object_set_mask", 2);
        DefineFunction("object_set_collisions", 2);
        DefineFunction("room_name", 1);
        DefineFunction("room_exists", 1);
        DefineFunction("room_get_name", 1);
        DefineFunction("room_set_width", 2);
        DefineFunction("room_set_height", 2);
        DefineFunction("room_set_persistent", 2);
        DefineFunction("room_set_background_color", 3);
        DefineFunction("room_set_background_colour", 3);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("room_set_background", 12);
            DefineFunction("room_set_view", 16);
        }
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("room_set_viewport", 7);
            DefineFunction("room_get_viewport", 2);
        }
        DefineFunction("room_set_view_enabled", 2);
        DefineFunction("room_add", 0);
        DefineFunction("room_duplicate", 1);
        DefineFunction("room_assign", 2);
        DefineFunction("room_instance_add", 4);
        DefineFunction("room_instance_clear", 1);
        DefineFunction("asset_get_index", 1);
        DefineFunction("asset_get_type", 1);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("room_tile_add", 9);
            DefineFunction("room_tile_add_ext", 12);
            DefineFunction("room_tile_clear", 1);
        }
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("room_get_camera", 2);
            DefineFunction("room_set_camera", 3);
        }
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("sound_play", 1);
            DefineFunction("sound_loop", 1);
            DefineFunction("sound_stop", 1);
            DefineFunction("sound_stop_all", 0);
            DefineFunction("sound_isplaying", 1);
            DefineFunction("sound_volume", 2);
            DefineFunction("sound_fade", 3);
            DefineFunction("sound_global_volume", 1);
        }
        DefineFunction("virtual_key_add", 5);
        DefineFunction("virtual_key_delete", 1);
        DefineFunction("virtual_key_show", 1);
        DefineFunction("virtual_key_hide", 1);
        DefineFunction("achievement_login", 0);
        DefineFunction("achievement_logout", 0);
        DefineFunction("achievement_post", 2);
        DefineFunction("achievement_increment", 2);
        DefineFunction("achievement_post_score", 2);
        DefineFunction("achievement_available", 0);
        DefineFunction("achievement_show_achievements", 0);
        DefineFunction("achievement_show_leaderboards", 0);
        DefineFunction("achievement_load_friends", 0);
        DefineFunction("achievement_load_leaderboard", 4);
        DefineFunction("achievement_send_challenge", 5);
        DefineFunction("achievement_load_progress", 0);
        DefineFunction("achievement_reset", 0);
        DefineFunction("achievement_login_status", 0);
        DefineFunction("achievement_get_pic", 1);
        DefineFunction("achievement_get_info", 1);
        DefineFunction("achievement_get_challenges", 0);
        DefineFunction("achievement_show_challenge_notifications", 3);
        DefineFunction("achievement_show", 2);
        DefineFunction("achievement_event", 1);
        DefineFunction("cloud_file_save", 2);
        DefineFunction("cloud_string_save", 2);
        DefineFunction("cloud_synchronise", 0);
        DefineFunction("url_get_domain", 0);
        DefineFunction("url_open", 1);
        DefineFunction("url_open_ext", 2);
        DefineFunction("url_open_full", 3);
        DefineFunction("ads_setup", 2);
        DefineFunction("ads_engagement_launch", 0);
        DefineFunction("ads_engagement_available", 0);
        DefineFunction("ads_engagement_active", 0);
        DefineFunction("ads_get_display_height", 1);
        DefineFunction("ads_get_display_width", 1);
        DefineFunction("ads_move", 3);
        DefineFunction("ads_interstitial_available", 0);
        DefineFunction("ads_interstitial_display", 0);
        DefineFunction("ads_enable", 3);
        DefineFunction("ads_disable", 1);
        DefineFunction("ads_event", 1);
        DefineFunction("ads_event_preload", 1);
        DefineFunction("shop_leave_rating", 4);
        DefineFunction("analytics_event", 1);
        DefineFunction("analytics_event_ext");
        DefineFunction("ads_set_reward_callback", 1);
        if (data?.GeneralInfo?.Major < 2)
        {
            DefineFunction("draw_enable_alphablend", 1);
        }
        DefineFunction("draw_texture_flush", 0);
        DefineFunction("draw_flush", 0);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("gpu_set_blendenable", 1);
            DefineFunction("gpu_set_ztestenable", 1);
            DefineFunction("gpu_set_zfunc", 1);
            DefineFunction("gpu_set_zwriteenable", 1);
            DefineFunction("gpu_set_fog", 4);
            DefineFunction("gpu_set_cullmode", 1);
            DefineFunction("gpu_set_blendmode", 1);
            DefineFunction("gpu_set_blendmode_ext", 2);
            DefineFunction("gpu_set_blendmode_ext_sepalpha", 4);
            DefineFunction("gpu_set_colorwriteenable");
            DefineFunction("gpu_set_colourwriteenable");
            DefineFunction("gpu_set_alphatestenable", 1);
            DefineFunction("gpu_set_alphatestref", 1);
            DefineFunction("gpu_set_alphatestfunc", 1);
            DefineFunction("gpu_set_texfilter", 1);
            DefineFunction("gpu_set_texfilter_ext", 2);
            DefineFunction("gpu_set_texrepeat", 1);
            DefineFunction("gpu_set_texrepeat_ext", 2);
            DefineFunction("gpu_set_tex_filter", 1);
            DefineFunction("gpu_set_tex_filter_ext", 2);
            DefineFunction("gpu_set_tex_repeat", 1);
            DefineFunction("gpu_set_tex_repeat_ext", 2);
            DefineFunction("gpu_set_tex_mip_filter", 1);
            DefineFunction("gpu_set_tex_mip_filter_ext", 2);
            DefineFunction("gpu_set_tex_mip_bias", 1);
            DefineFunction("gpu_set_tex_mip_bias_ext", 2);
            DefineFunction("gpu_set_tex_min_mip", 1);
            DefineFunction("gpu_set_tex_min_mip_ext", 2);
            DefineFunction("gpu_set_tex_max_mip", 1);
            DefineFunction("gpu_set_tex_max_mip_ext", 2);
            DefineFunction("gpu_set_tex_max_aniso", 1);
            DefineFunction("gpu_set_tex_max_aniso_ext", 2);
            DefineFunction("gpu_set_tex_mip_enable", 1);
            DefineFunction("gpu_set_tex_mip_enable_ext", 2);
            DefineFunction("gpu_get_blendenable", 0);
            DefineFunction("gpu_get_ztestenable", 0);
            DefineFunction("gpu_get_zfunc", 0);
            DefineFunction("gpu_get_zwriteenable", 0);
            DefineFunction("gpu_get_fog", 0);
            DefineFunction("gpu_get_cullmode", 0);
            DefineFunction("gpu_get_blendmode", 0);
            DefineFunction("gpu_get_blendmode_ext", 0);
            DefineFunction("gpu_get_blendmode_ext_sepalpha", 0);
            DefineFunction("gpu_get_blendmode_src", 0);
            DefineFunction("gpu_get_blendmode_dest", 0);
            DefineFunction("gpu_get_blendmode_srcalpha", 0);
            DefineFunction("gpu_get_blendmode_destalpha", 0);
            DefineFunction("gpu_get_colorwriteenable", 0);
            DefineFunction("gpu_get_colourwriteenable", 0);
            DefineFunction("gpu_get_alphatestenable", 0);
            DefineFunction("gpu_get_alphatestref", 0);
            DefineFunction("gpu_get_alphatestfunc", 0);
            DefineFunction("gpu_get_texfilter", 0);
            DefineFunction("gpu_get_texfilter_ext", 1);
            DefineFunction("gpu_get_texrepeat", 0);
            DefineFunction("gpu_get_texrepeat_ext", 1);
            DefineFunction("gpu_get_tex_filter", 0);
            DefineFunction("gpu_get_tex_filter_ext", 1);
            DefineFunction("gpu_get_tex_repeat", 0);
            DefineFunction("gpu_get_tex_repeat_ext", 1);
            DefineFunction("gpu_get_tex_mip_filter", 0);
            DefineFunction("gpu_get_tex_mip_filter_ext", 1);
            DefineFunction("gpu_get_tex_mip_bias", 0);
            DefineFunction("gpu_get_tex_mip_bias_ext", 1);
            DefineFunction("gpu_get_tex_min_mip", 0);
            DefineFunction("gpu_get_tex_min_mip_ext", 1);
            DefineFunction("gpu_get_tex_max_mip", 0);
            DefineFunction("gpu_get_tex_max_mip_ext", 1);
            DefineFunction("gpu_get_tex_max_aniso", 0);
            DefineFunction("gpu_get_tex_max_aniso_ext", 1);
            DefineFunction("gpu_get_tex_mip_enable", 0);
            DefineFunction("gpu_get_tex_mip_enable_ext", 1);
            DefineFunction("gpu_push_state", 0);
            DefineFunction("gpu_pop_state", 0);
            DefineFunction("gpu_get_state", 0);
            DefineFunction("gpu_set_state", 1);
            DefineFunction("draw_light_define_ambient", 1);
            DefineFunction("draw_light_define_direction", 5);
            DefineFunction("draw_light_define_point", 6);
            DefineFunction("draw_light_enable", 2);
            DefineFunction("draw_set_lighting", 1);
            DefineFunction("draw_light_get_ambient", 0);
            DefineFunction("draw_light_get", 1);
            DefineFunction("draw_get_lighting", 0);
        }
        DefineFunction("get_timer", 0);
        DefineFunction("os_get_config", 0);
        DefineFunction("os_get_info", 0);
        DefineFunction("os_get_language", 0);
        DefineFunction("os_get_region", 0);
        DefineFunction("os_check_permission", 1);
        DefineFunction("os_request_permission", 1);
        DefineFunction("display_get_dpi_x", 0);
        DefineFunction("display_get_dpi_y", 0);
        DefineFunction("display_set_gui_size", 2);
        DefineFunction("display_set_gui_maximise");
        DefineFunction("display_set_gui_maximize");
        DefineFunction("device_get_tilt_x", 0);
        DefineFunction("device_get_tilt_y", 0);
        DefineFunction("device_get_tilt_z", 0);
        DefineFunction("device_is_keypad_open", 0);
        DefineFunction("code_is_compiled", 0);
        DefineFunction("device_mouse_check_button", 2);
        DefineFunction("device_mouse_check_button_pressed", 2);
        DefineFunction("device_mouse_check_button_released", 2);
        DefineFunction("device_mouse_x", 1);
        DefineFunction("device_mouse_y", 1);
        DefineFunction("device_mouse_raw_x", 1);
        DefineFunction("device_mouse_raw_y", 1);
        DefineFunction("iap_activate", 1);
        DefineFunction("iap_status", 0);
        DefineFunction("iap_acquire", 2);
        DefineFunction("iap_consume", 1);
        DefineFunction("iap_is_purchased", 1);
        DefineFunction("iap_enumerate_products", 1);
        DefineFunction("iap_restore_all", 0);
        DefineFunction("iap_product_details", 2);
        DefineFunction("iap_purchase_details", 2);
        DefineFunction("iap_store_status", 0);
        DefineFunction("iap_product_status", 1);
        DefineFunction("iap_is_downloaded", 1);
        DefineFunction("iap_event_queue", 0);
        DefineFunction("iap_files_purchased", 0);
        DefineFunction("iap_product_files", 2);
        DefineFunction("facebook_init", 0);
        DefineFunction("facebook_login", 2);
        DefineFunction("facebook_status", 0);
        DefineFunction("facebook_graph_request", 4);
        DefineFunction("facebook_dialog", 3);
        DefineFunction("facebook_logout", 0);
        DefineFunction("facebook_launch_offerwall", 1);
        DefineFunction("facebook_post_message", 7);
        DefineFunction("facebook_send_invite", 5);
        DefineFunction("facebook_user_id", 0);
        DefineFunction("facebook_accesstoken", 0);
        DefineFunction("facebook_check_permission", 1);
        DefineFunction("facebook_request_read_permissions", 1);
        DefineFunction("facebook_request_publish_permissions", 1);
        DefineFunction("gamepad_is_supported", 0, FunctionClassification.Gamepad);
        DefineFunction("gamepad_get_device_count", 0, FunctionClassification.Gamepad);
        DefineFunction("gamepad_is_connected", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_get_description", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_get_button_threshold", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_set_button_threshold", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_get_axis_deadzone", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_set_axis_deadzone", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_button_count", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_button_check", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_button_check_pressed", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_button_check_released", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_button_value", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_axis_count", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_axis_value", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_set_vibration", 3, FunctionClassification.Gamepad);
        DefineFunction("gamepad_set_colour", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_set_color", 2, FunctionClassification.Gamepad);
        DefineFunction("gamepad_add_mapping_from_string", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_add_mapping_from_file", 1, FunctionClassification.Gamepad);
        DefineFunction("gamepad_get_database", 0, FunctionClassification.Gamepad);
        DefineFunction("YoYo_OSPauseEvent", 0);
        DefineFunction("os_is_paused", 0);
        DefineFunction("window_has_focus", 0);
        DefineFunction("base64_encode", 1);
        DefineFunction("base64_decode", 1);
        DefineFunction("md5_string_unicode", 1);
        DefineFunction("md5_string_utf8", 1);
        DefineFunction("md5_file", 1);
        DefineFunction("os_is_network_connected", 0);
        DefineFunction("sha1_string_unicode", 1);
        DefineFunction("sha1_string_utf8", 1);
        DefineFunction("sha1_file", 1);
        DefineFunction("os_powersave_enable", 1);
        DefineFunction("os_lock_orientation", 1);
        DefineFunction("physics_world_create", 1);
        DefineFunction("physics_world_gravity", 2);
        DefineFunction("physics_world_update_speed", 1);
        DefineFunction("physics_world_update_iterations", 1);
        DefineFunction("physics_world_draw_debug", 1);
        DefineFunction("physics_pause_enable", 1);
        DefineFunction("physics_fixture_create", 0);
        DefineFunction("physics_fixture_set_kinematic", 1);
        DefineFunction("physics_fixture_set_awake", 2);
        DefineFunction("physics_fixture_set_density", 2);
        DefineFunction("physics_fixture_set_restitution", 2);
        DefineFunction("physics_fixture_set_friction", 2);
        DefineFunction("physics_fixture_set_collision_group", 2);
        DefineFunction("physics_fixture_set_sensor", 2);
        DefineFunction("physics_fixture_set_linear_damping", 2);
        DefineFunction("physics_fixture_set_angular_damping", 2);
        DefineFunction("physics_fixture_set_circle_shape", 2);
        DefineFunction("physics_fixture_set_box_shape", 3);
        DefineFunction("physics_fixture_set_edge_shape", 5);
        DefineFunction("physics_fixture_set_polygon_shape", 1);
        DefineFunction("physics_fixture_set_chain_shape", 2);
        DefineFunction("physics_fixture_add_point", 3);
        DefineFunction("physics_fixture_bind", 2);
        DefineFunction("physics_fixture_bind_ext", 4);
        DefineFunction("physics_fixture_delete", 1);
        DefineFunction("physics_apply_force", 4);
        DefineFunction("physics_apply_impulse", 4);
        DefineFunction("physics_apply_angular_impulse", 1);
        DefineFunction("physics_apply_local_force", 4);
        DefineFunction("physics_apply_local_impulse", 4);
        DefineFunction("physics_apply_torque", 1);
        DefineFunction("physics_mass_properties", 4);
        DefineFunction("physics_draw_debug", 0);
        DefineFunction("physics_test_overlap", 4);
        DefineFunction("physics_remove_fixture", 2);
        DefineFunction("physics_get_friction", 1);
        DefineFunction("physics_get_density", 1);
        DefineFunction("physics_get_restitution", 1);
        DefineFunction("physics_set_friction", 2);
        DefineFunction("physics_set_density", 2);
        DefineFunction("physics_set_restitution", 2);
        DefineFunction("physics_joint_enable_motor", 2);
        DefineFunction("physics_joint_get_value", 2);
        DefineFunction("physics_joint_set_value", 3);
        DefineFunction("physics_joint_distance_create", 7);
        DefineFunction("physics_joint_rope_create", 8);
        DefineFunction("physics_joint_revolute_create", 11);
        DefineFunction("physics_joint_prismatic_create", 13);
        DefineFunction("physics_joint_pulley_create", 12);
        DefineFunction("physics_joint_wheel_create", 12);
        DefineFunction("physics_joint_weld_create", 8);
        DefineFunction("physics_joint_friction_create", 7);
        DefineFunction("physics_joint_gear_create", 5);
        DefineFunction("physics_joint_delete", 1);
        DefineFunction("physics_particle_create", 8);
        DefineFunction("physics_particle_delete", 1);
        DefineFunction("physics_particle_delete_region_circle", 3);
        DefineFunction("physics_particle_delete_region_box", 4);
        DefineFunction("physics_particle_delete_region_poly", 1);
        DefineFunction("physics_particle_set_flags", 2);
        DefineFunction("physics_particle_set_category_flags", 2);
        DefineFunction("physics_particle_draw", 4);
        DefineFunction("physics_particle_draw_ext", 9);
        DefineFunction("physics_particle_count", 0);
        DefineFunction("physics_particle_get_data", 2);
        DefineFunction("physics_particle_get_data_particle", 3);
        DefineFunction("physics_particle_group_begin", 12);
        DefineFunction("physics_particle_group_circle", 1);
        DefineFunction("physics_particle_group_box", 2);
        DefineFunction("physics_particle_group_polygon", 0);
        DefineFunction("physics_particle_group_add_point", 2);
        DefineFunction("physics_particle_group_end", 0);
        DefineFunction("physics_particle_group_join", 2);
        DefineFunction("physics_particle_group_delete", 1);
        DefineFunction("physics_particle_group_count", 1);
        DefineFunction("physics_particle_group_get_data", 3);
        DefineFunction("physics_particle_group_get_mass", 1);
        DefineFunction("physics_particle_group_get_inertia", 1);
        DefineFunction("physics_particle_group_get_centre_x", 1);
        DefineFunction("physics_particle_group_get_centre_y", 1);
        DefineFunction("physics_particle_group_get_vel_x", 1);
        DefineFunction("physics_particle_group_get_vel_y", 1);
        DefineFunction("physics_particle_group_get_ang_vel", 1);
        DefineFunction("physics_particle_group_get_x", 1);
        DefineFunction("physics_particle_group_get_y", 1);
        DefineFunction("physics_particle_group_get_angle", 1);
        DefineFunction("physics_particle_set_group_flags", 2);
        DefineFunction("physics_particle_get_group_flags", 1);
        DefineFunction("physics_particle_get_max_count", 0);
        DefineFunction("physics_particle_get_radius", 0);
        DefineFunction("physics_particle_get_density", 0);
        DefineFunction("physics_particle_get_damping", 0);
        DefineFunction("physics_particle_get_gravity_scale", 0);
        DefineFunction("physics_particle_set_max_count", 1);
        DefineFunction("physics_particle_set_radius", 1);
        DefineFunction("physics_particle_set_density", 1);
        DefineFunction("physics_particle_set_damping", 1);
        DefineFunction("physics_particle_set_gravity_scale", 1);
        DefineFunction("win8_livetile_tile_notification", 4);
        DefineFunction("win8_livetile_badge_notification", 1);
        DefineFunction("win8_livetile_tile_clear", 0);
        DefineFunction("win8_livetile_badge_clear", 0);
        DefineFunction("win8_livetile_queue_enable", 1);
        DefineFunction("win8_secondarytile_pin", 8);
        DefineFunction("win8_secondarytile_badge_notification", 2);
        DefineFunction("win8_secondarytile_delete", 1);
        DefineFunction("win8_livetile_notification_begin", 1);
        DefineFunction("win8_livetile_notification_secondary_begin", 2);
        DefineFunction("win8_livetile_notification_expiry", 1);
        DefineFunction("win8_livetile_notification_tag", 1);
        DefineFunction("win8_livetile_notification_text_add", 1);
        DefineFunction("win8_livetile_notification_image_add", 1);
        DefineFunction("win8_livetile_notification_end", 0);
        DefineFunction("win8_appbar_enable", 1);
        DefineFunction("win8_appbar_add_element", 6);
        DefineFunction("win8_appbar_remove_element", 1);
        DefineFunction("win8_settingscharm_add_entry", 2);
        DefineFunction("win8_settingscharm_add_html_entry", 3);
        DefineFunction("win8_settingscharm_add_xaml_entry", 5);
        DefineFunction("win8_settingscharm_set_xaml_property", 4);
        DefineFunction("win8_settingscharm_get_xaml_property", 3);
        DefineFunction("win8_settingscharm_remove_entry", 1);
        DefineFunction("win8_share_image", 4);
        DefineFunction("win8_share_screenshot", 3);
        DefineFunction("win8_share_file", 4);
        DefineFunction("win8_share_url", 4);
        DefineFunction("win8_share_text", 4);
        DefineFunction("win8_search_enable", 1);
        DefineFunction("win8_search_disable", 0);
        DefineFunction("win8_search_add_suggestions", 1);
        DefineFunction("win8_device_touchscreen_available", 0);
        DefineFunction("win8_license_initialize_sandbox", 1);
        DefineFunction("win8_license_trial_version", 0);
        DefineFunction("winphone_license_trial_version", 0);
        DefineFunction("winphone_tile_title", 1);
        DefineFunction("winphone_tile_count", 1);
        DefineFunction("winphone_tile_back_title", 1);
        DefineFunction("winphone_tile_back_content", 1);
        DefineFunction("winphone_tile_back_content_wide", 1);
        DefineFunction("winphone_tile_front_image", 1);
        DefineFunction("winphone_tile_front_image_small", 1);
        DefineFunction("winphone_tile_front_image_wide", 1);
        DefineFunction("winphone_tile_back_image", 1);
        DefineFunction("winphone_tile_back_image_wide", 1);
        DefineFunction("winphone_tile_background_color", 1);
        DefineFunction("winphone_tile_background_colour", 1);
        DefineFunction("winphone_tile_icon_image", 1);
        DefineFunction("winphone_tile_small_icon_image", 1);
        DefineFunction("winphone_tile_wide_content", 2);
        DefineFunction("winphone_tile_cycle_images");
        DefineFunction("winphone_tile_small_background_image", 1);
        DefineFunction("gml_release_mode", 1);
        DefineFunction("gml_pragma");
        DefineFunction("buffer_create", 3);
        DefineFunction("buffer_delete", 1);
        DefineFunction("buffer_get_type", 1);
        DefineFunction("buffer_get_alignment", 1);
        DefineFunction("buffer_exists", 1);
        DefineFunction("buffer_write", 3);
        DefineFunction("buffer_read", 2);
        DefineFunction("buffer_poke", 4);
        DefineFunction("buffer_peek", 3);
        DefineFunction("buffer_seek", 3);
        DefineFunction("buffer_save", 2);
        DefineFunction("buffer_save_ext", 4);
        DefineFunction("buffer_load", 1);
        DefineFunction("buffer_load_ext", 3);
        DefineFunction("buffer_load_partial", 5);
        DefineFunction("buffer_copy", 5);
        DefineFunction("buffer_fill", 5);
        DefineFunction("buffer_get_size", 1);
        DefineFunction("buffer_tell", 1);
        DefineFunction("buffer_resize", 2);
        DefineFunction("buffer_md5", 3);
        DefineFunction("buffer_sha1", 3);
        DefineFunction("buffer_base64_encode", 3);
        DefineFunction("buffer_base64_decode", 1);
        DefineFunction("buffer_base64_decode_ext", 3);
        DefineFunction("buffer_sizeof", 1);
        DefineFunction("buffer_get_address", 1);
        DefineFunction("buffer_save_async", 4);
        DefineFunction("buffer_load_async", 4);
        DefineFunction("buffer_async_group_begin", 1);
        DefineFunction("buffer_async_group_end", 0);
        DefineFunction("buffer_async_group_option", 2);
        DefineFunction("buffer_get_surface", ((data?.IsVersionAtLeast(2, 3, 1) ?? false) ? 3 : 5)); // be more robust here
        DefineFunction("buffer_set_surface", 5);
        DefineFunction("buffer_set_network_safe", 2);
        DefineFunction("buffer_create_from_vertex_buffer", 3);
        DefineFunction("buffer_create_from_vertex_buffer_ext", 5);
        DefineFunction("buffer_copy_from_vertex_buffer", 5);
        DefineFunction("buffer_compress", 3);
        DefineFunction("buffer_decompress", 1);
        DefineFunction("network_create_socket", 1);
        DefineFunction("network_create_socket_ext", 2);
        DefineFunction("network_create_server", 3);
        DefineFunction("network_create_server_raw", 3);
        DefineFunction("network_connect", 3);
        DefineFunction("network_connect_raw", 3);
        DefineFunction("network_send_packet", 3);
        DefineFunction("network_send_raw", 3);
        DefineFunction("network_send_broadcast", 4);
        DefineFunction("network_send_udp", 5);
        DefineFunction("network_send_udp_raw", 5);
        DefineFunction("network_resolve", 1);
        DefineFunction("network_receive_packet", 3);
        DefineFunction("network_destroy", 1);
        DefineFunction("network_set_timeout", 3);
        DefineFunction("network_get_address", 1);
        DefineFunction("network_set_config", 2);
        DefineFunction("steam_activate_overlay", 1);
        DefineFunction("steam_is_overlay_enabled", 0);
        DefineFunction("steam_is_overlay_activated", 0);
        DefineFunction("steam_get_persona_name", 0);
        DefineFunction("steam_initialised", 0);
        DefineFunction("steam_is_cloud_enabled_for_app", 0);
        DefineFunction("steam_is_cloud_enabled_for_account", 0);
        DefineFunction("steam_file_persisted", 1);
        DefineFunction("steam_get_quota_total", 0);
        DefineFunction("steam_get_quota_free", 0);
        DefineFunction("steam_file_write", 3);
        DefineFunction("steam_file_write_file", 2);
        DefineFunction("steam_file_read", 1);
        DefineFunction("steam_file_delete", 1);
        DefineFunction("steam_file_exists", 1);
        DefineFunction("steam_file_size", 1);
        DefineFunction("steam_file_share", 1);
        DefineFunction("steam_publish_workshop_file", 4);
        DefineFunction("steam_is_screenshot_requested", 0);
        DefineFunction("steam_send_screenshot", 3);
        DefineFunction("steam_is_user_logged_on", 0);
        DefineFunction("steam_get_user_steam_id", 0);
        DefineFunction("steam_user_owns_dlc", 1);
        DefineFunction("steam_user_installed_dlc", 1);
        DefineFunction("steam_set_achievement", 1);
        DefineFunction("steam_get_achievement", 1);
        DefineFunction("steam_clear_achievement", 1);
        DefineFunction("steam_set_stat_int", 2);
        DefineFunction("steam_set_stat_float", 2);
        DefineFunction("steam_set_stat_avg_rate", 3);
        DefineFunction("steam_get_stat_int", 1);
        DefineFunction("steam_get_stat_float", 1);
        DefineFunction("steam_get_stat_avg_rate", 1);
        DefineFunction("steam_reset_all_stats", 0);
        DefineFunction("steam_reset_all_stats_achievements", 0);
        DefineFunction("steam_stats_ready", 0);
        DefineFunction("steam_create_leaderboard", 3);
        DefineFunction("steam_upload_score", 2);
        DefineFunction("steam_upload_score_ext", 3);
        DefineFunction("steam_upload_score_buffer", 3);
        DefineFunction("steam_upload_score_buffer_ext", 4);
        DefineFunction("steam_download_scores_around_user", 3);
        DefineFunction("steam_download_scores", 3);
        DefineFunction("steam_download_friends_scores", 1);
        DefineFunction("steam_current_game_language", 0);
        DefineFunction("steam_available_languages", 0);
        DefineFunction("steam_activate_overlay_browser", 1);
        DefineFunction("steam_activate_overlay_user", 2);
        DefineFunction("steam_activate_overlay_store", 1);
        DefineFunction("steam_get_user_persona_name", 1);
        DefineFunction("steam_get_app_id", 0);
        DefineFunction("steam_get_user_account_id", 0);
        DefineFunction("steam_ugc_download", 2);
        DefineFunction("steam_ugc_create_item", 2);
        DefineFunction("steam_ugc_start_item_update", 2);
        DefineFunction("steam_ugc_set_item_title", 2);
        DefineFunction("steam_ugc_set_item_description", 2);
        DefineFunction("steam_ugc_set_item_visibility", 2);
        DefineFunction("steam_ugc_set_item_tags", 2);
        DefineFunction("steam_ugc_set_item_content", 2);
        DefineFunction("steam_ugc_set_item_preview", 2);
        DefineFunction("steam_ugc_submit_item_update", 2);
        DefineFunction("steam_ugc_get_item_update_progress", 2);
        DefineFunction("steam_ugc_subscribe_item", 1);
        DefineFunction("steam_ugc_unsubscribe_item", 1);
        DefineFunction("steam_ugc_num_subscribed_items", 0);
        DefineFunction("steam_ugc_get_subscribed_items", 1);
        DefineFunction("steam_ugc_get_item_install_info", 2);
        DefineFunction("steam_ugc_get_item_update_info", 2);
        DefineFunction("steam_ugc_request_item_details", 2);
        DefineFunction("steam_ugc_create_query_user", 4);
        DefineFunction("steam_ugc_create_query_user_ex", 7);
        DefineFunction("steam_ugc_create_query_all", 3);
        DefineFunction("steam_ugc_create_query_all_ex", 5);
        DefineFunction("steam_ugc_query_set_cloud_filename_filter", 2);
        DefineFunction("steam_ugc_query_set_match_any_tag", 2);
        DefineFunction("steam_ugc_query_set_search_text", 2);
        DefineFunction("steam_ugc_query_set_ranked_by_trend_days", 2);
        DefineFunction("steam_ugc_query_add_required_tag", 2);
        DefineFunction("steam_ugc_query_add_excluded_tag", 2);
        DefineFunction("steam_ugc_query_set_return_long_description", 2);
        DefineFunction("steam_ugc_query_set_return_total_only", 2);
        DefineFunction("steam_ugc_query_set_allow_cached_response", 2);
        DefineFunction("steam_ugc_send_query", 1);
        DefineFunction("shader_set", 1);
        DefineFunction("shader_get_name", 1);
        DefineFunction("shader_reset", 0);
        DefineFunction("shader_current", 0);
        DefineFunction("shader_is_compiled", 1);
        DefineFunction("shader_get_sampler_index", 2);
        DefineFunction("shader_get_uniform", 2);
        DefineFunction("shader_set_uniform_i");
        DefineFunction("shader_set_uniform_i_array", 2);
        DefineFunction("shader_set_uniform_i1", 1);
        DefineFunction("shader_set_uniform_f");
        DefineFunction("shader_set_uniform_f_array", 2);
        DefineFunction("shader_set_uniform_matrix", 1);
        DefineFunction("shader_set_uniform_matrix_array", 2);
        DefineFunction("texture_set_stage", 2);
        DefineFunction("texture_get_texel_width", 1);
        DefineFunction("texture_get_texel_height", 1);
        DefineFunction("shaders_are_supported", 0);
        DefineFunction("vertex_format_begin", 0);
        DefineFunction("vertex_format_end", 0);
        DefineFunction("vertex_format_delete", 1);
        DefineFunction("vertex_format_add_position", 0);
        DefineFunction("vertex_format_add_position_3d", 0);
        DefineFunction("vertex_format_add_colour", 0);
        DefineFunction("vertex_format_add_color", 0);
        DefineFunction("vertex_format_add_normal", 0);
        DefineFunction("vertex_format_add_texcoord", 0);
        DefineFunction("vertex_format_add_textcoord", 0);
        DefineFunction("vertex_format_add_custom", 2);
        DefineFunction("vertex_create_buffer", 0);
        DefineFunction("vertex_create_buffer_ext", 1);
        DefineFunction("vertex_delete_buffer", 1);
        DefineFunction("vertex_begin", 2);
        DefineFunction("vertex_end", 1);
        DefineFunction("vertex_position", 3);
        DefineFunction("vertex_position_3d", 4);
        DefineFunction("vertex_colour", 3);
        DefineFunction("vertex_color", 3);
        DefineFunction("vertex_argb", 2);
        DefineFunction("vertex_texcoord", 3);
        DefineFunction("vertex_normal", 4);
        DefineFunction("vertex_float1", 2);
        DefineFunction("vertex_float2", 3);
        DefineFunction("vertex_float3", 4);
        DefineFunction("vertex_float4", 5);
        DefineFunction("vertex_ubyte4", 5);
        DefineFunction("vertex_submit", 3);
        DefineFunction("vertex_freeze", 1);
        DefineFunction("vertex_get_number", 1);
        DefineFunction("vertex_get_buffer_size", 1);
        DefineFunction("vertex_create_buffer_from_buffer", 2);
        DefineFunction("vertex_create_buffer_from_buffer_ext", 4);
        DefineFunction("push_local_notification", 4);
        DefineFunction("push_get_first_local_notification", 1);
        DefineFunction("push_get_next_local_notification", 1);
        DefineFunction("push_cancel_local_notification", 1);
        DefineFunction("skeleton_animation_set", 1);
        DefineFunction("skeleton_animation_get", 0);
        DefineFunction("skeleton_animation_mix", 3);
        DefineFunction("skeleton_animation_set_ext", 2);
        DefineFunction("skeleton_animation_get_ext", 1);
        DefineFunction("skeleton_animation_get_duration", 1);
        DefineFunction("skeleton_animation_get_frames", 1);
        DefineFunction("skeleton_animation_clear", 1);
        DefineFunction("skeleton_skin_set", 1);
        DefineFunction("skeleton_skin_get", 0);
        DefineFunction("skeleton_attachment_set", 2);
        DefineFunction("skeleton_attachment_get", 1);
        DefineFunction("skeleton_attachment_create", 8);
        DefineFunction("skeleton_collision_draw_set", 1);
        DefineFunction("skeleton_bone_data_get", 2);
        DefineFunction("skeleton_bone_data_set", 2);
        DefineFunction("skeleton_bone_state_get", 2);
        DefineFunction("skeleton_bone_state_set", 2);
        DefineFunction("draw_skeleton", 11);
        DefineFunction("draw_skeleton_time", 11);
        DefineFunction("draw_skeleton_instance", 11);
        DefineFunction("draw_skeleton_collision", 9);
        DefineFunction("skeleton_animation_list", 2);
        DefineFunction("skeleton_skin_list", 2);
        DefineFunction("skeleton_slot_data", 2);
        DefineFunction("skeleton_animation_get_frame", 1);
        DefineFunction("skeleton_animation_set_frame", 2);
        DefineFunction("skeleton_get_minmax", 0);
        DefineFunction("skeleton_get_num_bounds", 0);
        DefineFunction("skeleton_get_bounds", 1);
        DefineFunction("yyg_player_run", 4);
        DefineFunction("yyg_player_restarted", 0);
        DefineFunction("yyg_player_launch_args", 0);
        DefineFunction("extension_stubfunc_real");
        DefineFunction("extension_stubfunc_string");
        DefineFunction("ps4_share_screenshot_enable", 1);
        DefineFunction("ps4_share_video_enable", 1);
        DefineFunction("ps4_gamepad_reset_colour", 1);
        DefineFunction("video_open", 1);
        DefineFunction("video_close", 0);
        DefineFunction("video_draw", 0);
        DefineFunction("video_set_volume", 1);
        DefineFunction("psn_get_leaderboard_score_range", 4);
        DefineFunction("psn_default_user_name", 0);
        DefineFunction("psn_name_for_pad", 1);
        DefineFunction("psn_unlock_trophy", 2);
        DefineFunction("psn_init_np_libs");
        DefineFunction("psn_exit_np_libs", 0);
        DefineFunction("psn_get_leaderboard_score", 2);
        DefineFunction("psn_post_leaderboard_score", 3);
        DefineFunction("psn_post_leaderboard_score_comment", 4);
        DefineFunction("psn_check_np_availability", 2);
        DefineFunction("psn_tick_error_dialog", 0);
        DefineFunction("psn_get_friends_scores", 4);
        DefineFunction("psn_name_for_user", 1);
        DefineFunction("psn_default_user", 0);
        DefineFunction("psn_user_for_pad", 1);
        DefineFunction("psn_tick", 0);
        DefineFunction("psn_np_status", 1);
        DefineFunction("psn_show_error_dialog", 1);
        DefineFunction("psn_check_free_space", 2);
        DefineFunction("psn_init_leaderboard", 1);
        DefineFunction("psn_np_check_plus", 3);
        DefineFunction("psn_np_commerce_dialog_open", 3);
        DefineFunction("psn_np_commerce_dialog_open_on_product", 3);
        DefineFunction("psn_np_commerce_dialog_tick", 0);
        DefineFunction("psn_np_notify_plus_feature", 3);
        DefineFunction("psn_set_content_restriction", 1);
        DefineFunction("psn_load_modules", 0);
        DefineFunction("psn_get_avatar_url", 1);
        DefineFunction("psn_get_tus_data", 2);
        DefineFunction("psn_set_tus_data", 4);
        DefineFunction("psn_get_tus_variable", 2);
        DefineFunction("psn_set_tus_variable", 3);
        DefineFunction("psn_delete_tus_data", 2);
        DefineFunction("psn_get_entitlement_list", 0);
        DefineFunction("matchmaking_reset_create_params", 0);
        DefineFunction("matchmaking_add_create_param", 2);
        DefineFunction("matchmaking_session_create", 2);
        DefineFunction("matchmaking_session_get_users", 1);
        DefineFunction("matchmaking_session_get_owner", 1);
        DefineFunction("matchmaking_session_get_ping_info", 1);
        DefineFunction("matchmaking_session_set_hidden", 2);
        DefineFunction("matchmaking_session_set_closed", 1);
        DefineFunction("matchmaking_session_set_open", 1);
        DefineFunction("matchmaking_reset_find_params", 0);
        DefineFunction("matchmaking_add_find_param", 3);
        DefineFunction("matchmaking_session_find", 0);
        DefineFunction("matchmaking_session_join", 1);
        DefineFunction("matchmaking_session_leave", 1);
        DefineFunction("matchmaking_session_update", 1);
        DefineFunction("matchmaking_start");
        DefineFunction("matchmaking_stop", 0);
        DefineFunction("matchmaking_session_invite_start", 1);
        DefineFunction("matchmaking_send_invites_no_ui", 4);
        DefineFunction("matchmaking_send_invites", 3);
        DefineFunction("matchmaking_tick_invites", 0);
        DefineFunction("matchmaking_join_invite", 1);
        DefineFunction("psn_content_restriction_add", 2);
        DefineFunction("psn_net_check", 1);
        DefineFunction("psn_setup_trophies", 0);
        DefineFunction("psn_init_trophy");
        DefineFunction("psn_get_trophy_unlock_state", 1);
        DefineFunction("xboxone_get_user_count", 0);
        DefineFunction("xboxone_get_user", 1);
        DefineFunction("xboxone_get_activating_user", 0);
        DefineFunction("xboxone_user_is_active", 1);
        DefineFunction("xboxone_user_is_guest", 1);
        DefineFunction("xboxone_user_is_signed_in", 1);
        DefineFunction("xboxone_user_is_remote", 1);
        DefineFunction("xboxone_gamedisplayname_for_user", 1);
        DefineFunction("xboxone_appdisplayname_for_user", 1);
        DefineFunction("xboxone_agegroup_for_user", 1);
        DefineFunction("xboxone_gamerscore_for_user", 1);
        DefineFunction("xboxone_reputation_for_user", 1);
        DefineFunction("xboxone_user_for_pad", 1);
        DefineFunction("xboxone_pad_count_for_user", 1);
        DefineFunction("xboxone_sponsor_for_user", 1);
        DefineFunction("xboxone_pad_for_user", 2);
        DefineFunction("xboxone_show_account_picker", 2);
        DefineFunction("xboxone_sprite_add_from_gamerpicture", 4);
        DefineFunction("xboxone_show_profile_card_for_user", 2);
        DefineFunction("xboxone_set_savedata_user", 1);
        DefineFunction("xboxone_get_savedata_user", 0);
        DefineFunction("xboxone_get_file_error", 0);
        DefineFunction("xboxone_was_terminated", 0);
        DefineFunction("xboxone_was_closed_by_user", 0);
        DefineFunction("xboxone_is_suspending", 0);
        DefineFunction("xboxone_is_constrained", 0);
        DefineFunction("xboxone_suspend", 0);
        DefineFunction("xboxone_show_help", 1);
        DefineFunction("xboxone_license_trial_version", 0);
        DefineFunction("xboxone_license_trial_user", 0);
        DefineFunction("xboxone_license_trial_time_remaining", 0);
        DefineFunction("xboxone_check_privilege", 3);
        DefineFunction("xboxone_user_id_for_user", 1);
        DefineFunction("xboxone_fire_event");
        DefineFunction("xboxone_get_stats_for_user");
        DefineFunction("xboxone_stats_setup", 3);
        DefineFunction("xboxone_stats_set_stat_real", 3);
        DefineFunction("xboxone_stats_set_stat_int", 3);
        DefineFunction("xboxone_stats_set_stat_string", 3);
        DefineFunction("xboxone_stats_delete_stat", 2);
        DefineFunction("xboxone_stats_get_stat", 2);
        DefineFunction("xboxone_stats_get_stat_names", 1);
        DefineFunction("xboxone_stats_add_user", 1);
        DefineFunction("xboxone_stats_remove_user", 1);
        DefineFunction("xboxone_stats_flush_user", 2);
        DefineFunction("xboxone_stats_get_leaderboard", 6);
        DefineFunction("xboxone_stats_get_social_leaderboard", 7);
        DefineFunction("xboxone_achievements_set_progress", 3);
        DefineFunction("xboxone_set_rich_presence");
        DefineFunction("xboxone_read_player_leaderboard", 4);
        DefineFunction("xboxone_matchmaking_create");
        DefineFunction("xboxone_matchmaking_find");
        DefineFunction("xboxone_matchmaking_start", 1);
        DefineFunction("xboxone_matchmaking_stop", 1);
        DefineFunction("xboxone_matchmaking_session_get_users", 1);
        DefineFunction("xboxone_matchmaking_session_leave", 1);
        DefineFunction("xboxone_matchmaking_send_invites", 3);
        DefineFunction("xboxone_matchmaking_set_joinable_session", 2);
        DefineFunction("xboxone_matchmaking_join_invite", 4);
        DefineFunction("xboxone_matchmaking_join_session", 3);
        DefineFunction("xboxone_matchmaking_set_find_timeout", 1);
        DefineFunction("xboxone_debug", 2);
        DefineFunction("xboxone_chat_add_user_to_channel", 2);
        DefineFunction("xboxone_chat_remove_user_from_channel", 2);
        DefineFunction("xboxone_chat_set_muted", 2);
        DefineFunction("xboxone_product_show_details", 2);
        DefineFunction("xboxone_set_service_configuration_id", 1);
        DefineFunction("xboxone_generate_player_session_id", 0);
        DefineFunction("xboxone_package_check_license", 1);
        DefineFunction("xboxlive_get_user_count", 0);
        DefineFunction("xboxlive_get_user", 1);
        DefineFunction("xboxlive_get_activating_user", 0);
        DefineFunction("xboxlive_user_is_active", 1);
        DefineFunction("xboxlive_user_is_guest", 1);
        DefineFunction("xboxlive_user_is_signed_in");
        DefineFunction("xboxlive_user_is_signing_in");
        DefineFunction("xboxlive_user_is_remote", 1);
        DefineFunction("xboxlive_gamedisplayname_for_user");
        DefineFunction("xboxlive_appdisplayname_for_user");
        DefineFunction("xboxlive_gamertag_for_user");
        DefineFunction("xboxlive_agegroup_for_user", 1);
        DefineFunction("xboxlive_gamerscore_for_user", 1);
        DefineFunction("xboxlive_reputation_for_user", 1);
        DefineFunction("xboxlive_user_for_pad", 1);
        DefineFunction("xboxlive_pad_count_for_user", 1);
        DefineFunction("xboxlive_sponsor_for_user", 1);
        DefineFunction("xboxlive_pad_for_user", 2);
        DefineFunction("xboxlive_show_account_picker");
        DefineFunction("xboxlive_sprite_add_from_gamerpicture", 4);
        DefineFunction("xboxlive_show_profile_card_for_user", 2);
        DefineFunction("xboxlive_set_savedata_user", 1);
        DefineFunction("xboxlive_get_savedata_user", 0);
        DefineFunction("xboxlive_get_file_error", 0);
        DefineFunction("uwp_was_terminated", 0);
        DefineFunction("uwp_was_closed_by_user", 0);
        DefineFunction("uwp_is_suspending", 0);
        DefineFunction("uwp_is_constrained", 0);
        DefineFunction("uwp_suspend", 0);
        DefineFunction("uwp_show_help", 1);
        DefineFunction("uwp_license_trial_version", 0);
        DefineFunction("uwp_license_trial_user", 0);
        DefineFunction("uwp_license_trial_time_remaining", 0);
        DefineFunction("uwp_check_privilege", 3);
        DefineFunction("xboxlive_user_id_for_user", 1);
        DefineFunction("xboxlive_fire_event");
        DefineFunction("xboxlive_get_stats_for_user");
        DefineFunction("xboxlive_stats_setup", 3);
        DefineFunction("xboxlive_stats_set_stat_real", 3);
        DefineFunction("xboxlive_stats_set_stat_int", 3);
        DefineFunction("xboxlive_stats_set_stat_string", 3);
        DefineFunction("xboxlive_stats_delete_stat", 2);
        DefineFunction("xboxlive_stats_get_stat", 2);
        DefineFunction("xboxlive_stats_get_stat_names", 1);
        DefineFunction("xboxlive_stats_add_user", 1);
        DefineFunction("xboxlive_stats_remove_user", 1);
        DefineFunction("xboxlive_stats_flush_user", 2);
        DefineFunction("xboxlive_stats_get_leaderboard", 6);
        DefineFunction("xboxlive_stats_get_social_leaderboard", 7);
        DefineFunction("xboxlive_achievements_set_progress", 3);
        DefineFunction("xboxlive_set_rich_presence");
        DefineFunction("xboxlive_read_player_leaderboard", 4);
        DefineFunction("xboxlive_matchmaking_create");
        DefineFunction("xboxlive_matchmaking_find");
        DefineFunction("xboxlive_matchmaking_start", 1);
        DefineFunction("xboxlive_matchmaking_stop", 1);
        DefineFunction("xboxlive_matchmaking_session_get_users", 1);
        DefineFunction("xboxlive_matchmaking_session_leave", 1);
        DefineFunction("xboxlive_matchmaking_send_invites", 3);
        DefineFunction("xboxlive_matchmaking_set_joinable_session", 2);
        DefineFunction("xboxlive_matchmaking_join_invite", 3);
        DefineFunction("xboxlive_matchmaking_join_session", 3);
        DefineFunction("xboxlive_matchmaking_set_find_timeout", 1);
        DefineFunction("xboxlive_chat_add_user_to_channel", 2);
        DefineFunction("xboxlive_chat_remove_user_from_channel", 2);
        DefineFunction("xboxlive_chat_set_muted", 2);
        DefineFunction("xboxlive_set_service_configuration_id", 1);
        DefineFunction("xboxlive_generate_player_session_id", 0);
        DefineFunction("browser_input_capture", 1);
        if (data?.GeneralInfo?.Major >= 2)
        {
            DefineFunction("layer_get_id", 1);
            DefineFunction("layer_get_id_at_depth", 1);
            DefineFunction("layer_get_depth", 1);
            DefineFunction("layer_create");
            DefineFunction("layer_destroy", 1);
            DefineFunction("layer_destroy_instances", 1);
            DefineFunction("layer_add_instance", 2);
            DefineFunction("layer_has_instance", 2);
            DefineFunction("layer_set_visible", 2);
            DefineFunction("layer_get_visible", 1);
            DefineFunction("layer_exists", 1);
            DefineFunction("layer_x", 2);
            DefineFunction("layer_y", 2);
            DefineFunction("layer_get_x", 1);
            DefineFunction("layer_get_y", 1);
            DefineFunction("layer_hspeed", 2);
            DefineFunction("layer_vspeed", 2);
            DefineFunction("layer_get_hspeed", 1);
            DefineFunction("layer_get_vspeed", 1);
            DefineFunction("layer_sprite_get_id", 2);
            DefineFunction("layer_sprite_exists", 2);
            DefineFunction("layer_script_begin", 2);
            DefineFunction("layer_script_end", 2);
            DefineFunction("layer_shader", 2);
            DefineFunction("layer_get_script_begin", 1);
            DefineFunction("layer_get_script_end", 1);
            DefineFunction("layer_get_shader", 1);
            DefineFunction("layer_set_target_room", 1);
            DefineFunction("layer_get_target_room", 0);
            DefineFunction("layer_reset_target_room", 0);
            DefineFunction("layer_get_all", 0);
            DefineFunction("layer_get_all_elements", 1);
            DefineFunction("layer_get_name", 1);
            DefineFunction("layer_depth", 2);
            DefineFunction("layer_get_element_layer", 1);
            DefineFunction("layer_get_element_type", 1);
            DefineFunction("layer_element_move", 2);
            DefineFunction("layer_force_draw_depth", 2);
            DefineFunction("layer_is_draw_depth_forced", 0);
            DefineFunction("layer_get_forced_depth", 0);
            DefineFunction("layer_background_get_id", 1);
            DefineFunction("layer_background_exists", 2);
            DefineFunction("layer_background_create", 2);
            DefineFunction("layer_background_destroy", 1);
            DefineFunction("layer_background_visible", 2);
            DefineFunction("layer_background_htiled", 2);
            DefineFunction("layer_background_vtiled", 2);
            DefineFunction("layer_background_xscale", 2);
            DefineFunction("layer_background_yscale", 2);
            DefineFunction("layer_background_stretch", 2);
            DefineFunction("layer_background_blend", 2);
            DefineFunction("layer_background_alpha", 2);
            DefineFunction("layer_background_index", 2);
            DefineFunction("layer_background_speed", 2);
            DefineFunction("layer_background_sprite", 2);
            DefineFunction("layer_background_change", 2);
            DefineFunction("layer_background_get_visible", 1);
            DefineFunction("layer_background_get_sprite", 1);
            DefineFunction("layer_background_get_htiled", 1);
            DefineFunction("layer_background_get_vtiled", 1);
            DefineFunction("layer_background_get_stretch", 1);
            DefineFunction("layer_background_get_xscale", 1);
            DefineFunction("layer_background_get_yscale", 1);
            DefineFunction("layer_background_get_blend", 1);
            DefineFunction("layer_background_get_alpha", 1);
            DefineFunction("layer_background_get_index", 1);
            DefineFunction("layer_background_get_speed", 1);
            DefineFunction("layer_sprite_create", 4);
            DefineFunction("layer_sprite_destroy", 1);
            DefineFunction("layer_sprite_change", 2);
            DefineFunction("layer_sprite_index", 2);
            DefineFunction("layer_sprite_speed", 2);
            DefineFunction("layer_sprite_xscale", 2);
            DefineFunction("layer_sprite_yscale", 2);
            DefineFunction("layer_sprite_angle", 2);
            DefineFunction("layer_sprite_blend", 2);
            DefineFunction("layer_sprite_alpha", 2);
            DefineFunction("layer_sprite_x", 2);
            DefineFunction("layer_sprite_y", 2);
            DefineFunction("layer_sprite_get_sprite", 1);
            DefineFunction("layer_sprite_get_index", 1);
            DefineFunction("layer_sprite_get_speed", 1);
            DefineFunction("layer_sprite_get_xscale", 1);
            DefineFunction("layer_sprite_get_yscale", 1);
            DefineFunction("layer_sprite_get_angle", 1);
            DefineFunction("layer_sprite_get_blend", 1);
            DefineFunction("layer_sprite_get_alpha", 1);
            DefineFunction("layer_sprite_get_x", 1);
            DefineFunction("layer_sprite_get_y", 1);
            DefineFunction("layer_tilemap_get_id", 1);
            DefineFunction("layer_tilemap_exists", 2);
            DefineFunction("layer_tilemap_create", 6);
            DefineFunction("layer_tilemap_destroy", 1);
            DefineFunction("tilemap_tileset", 2);
            DefineFunction("tilemap_x", 2);
            DefineFunction("tilemap_y", 2);
            DefineFunction("tilemap_set", 4);
            DefineFunction("tilemap_set_at_pixel", 4);
            DefineFunction("tilemap_get_tileset", 1);
            DefineFunction("tilemap_get_tile_width", 1);
            DefineFunction("tilemap_get_tile_height", 1);
            DefineFunction("tilemap_get_width", 1);
            DefineFunction("tilemap_get_height", 1);
            DefineFunction("tilemap_set_width", 2);
            DefineFunction("tilemap_set_height", 2);
            DefineFunction("tilemap_get_x", 1);
            DefineFunction("tilemap_get_y", 1);
            DefineFunction("tilemap_get", 3);
            DefineFunction("tilemap_get_at_pixel", 3);
            DefineFunction("tilemap_get_cell_x_at_pixel", 3);
            DefineFunction("tilemap_get_cell_y_at_pixel", 3);
            DefineFunction("tilemap_clear", 2);
            DefineFunction("draw_tilemap", 3);
            DefineFunction("draw_tile", 5);
            DefineFunction("tilemap_set_global_mask", 1);
            DefineFunction("tilemap_get_global_mask", 0);
            DefineFunction("tilemap_set_mask", 2);
            DefineFunction("tilemap_get_mask", 1);
            DefineFunction("tilemap_get_frame", 1);
            DefineFunction("tile_set_empty", 1);
            DefineFunction("tile_set_index", 2);
            DefineFunction("tile_set_flip", 2);
            DefineFunction("tile_set_mirror", 2);
            DefineFunction("tile_set_rotate", 2);
            DefineFunction("tile_get_empty", 1);
            DefineFunction("tile_get_index", 1);
            DefineFunction("tile_get_flip", 1);
            DefineFunction("tile_get_mirror", 1);
            DefineFunction("tile_get_rotate", 1);
            DefineFunction("layer_tile_exists");
            DefineFunction("layer_tile_create", 8);
            DefineFunction("layer_tile_destroy", 1);
            DefineFunction("layer_tile_change", 2);
            DefineFunction("layer_tile_xscale", 2);
            DefineFunction("layer_tile_yscale", 2);
            DefineFunction("layer_tile_blend", 2);
            DefineFunction("layer_tile_alpha", 2);
            DefineFunction("layer_tile_x", 2);
            DefineFunction("layer_tile_y", 2);
            DefineFunction("layer_tile_region", 5);
            DefineFunction("layer_tile_visible", 2);
            DefineFunction("layer_tile_get_sprite", 1);
            DefineFunction("layer_tile_get_xscale", 1);
            DefineFunction("layer_tile_get_yscale", 1);
            DefineFunction("layer_tile_get_blend", 1);
            DefineFunction("layer_tile_get_alpha", 1);
            DefineFunction("layer_tile_get_x", 1);
            DefineFunction("layer_tile_get_y", 1);
            DefineFunction("layer_tile_get_region", 1);
            DefineFunction("layer_tile_get_visible", 1);
            DefineFunction("layer_instance_get_instance", 1);
            DefineFunction("camera_create", 0);
            DefineFunction("camera_create_view");
            DefineFunction("camera_destroy", 1);
            DefineFunction("camera_apply", 1);
            DefineFunction("camera_get_active", 0);
            DefineFunction("camera_get_default", 0);
            DefineFunction("camera_set_default", 1);
            DefineFunction("camera_set_view_mat", 2);
            DefineFunction("camera_set_proj_mat", 2);
            DefineFunction("camera_set_update_script", 2);
            DefineFunction("camera_set_begin_script", 2);
            DefineFunction("camera_set_end_script", 2);
            DefineFunction("camera_set_view_pos", 3);
            DefineFunction("camera_set_view_size", 3);
            DefineFunction("camera_set_view_speed", 3);
            DefineFunction("camera_set_view_border", 3);
            DefineFunction("camera_set_view_angle", 2);
            DefineFunction("camera_set_view_target", 2);
            DefineFunction("camera_get_view_mat", 1);
            DefineFunction("camera_get_proj_mat", 1);
            DefineFunction("camera_get_update_script", 1);
            DefineFunction("camera_get_begin_script", 1);
            DefineFunction("camera_get_end_script", 1);
            DefineFunction("camera_get_view_x", 1);
            DefineFunction("camera_get_view_y", 1);
            DefineFunction("camera_get_view_width", 1);
            DefineFunction("camera_get_view_height", 1);
            DefineFunction("camera_get_view_speed_x", 1);
            DefineFunction("camera_get_view_speed_y", 1);
            DefineFunction("camera_get_view_border_x", 1);
            DefineFunction("camera_get_view_border_y", 1);
            DefineFunction("camera_get_view_angle", 1);
            DefineFunction("camera_get_view_target", 1);
            DefineFunction("view_get_camera", 1);
            DefineFunction("view_get_visible", 1);
            DefineFunction("view_get_xport", 1);
            DefineFunction("view_get_yport", 1);
            DefineFunction("view_get_wport", 1);
            DefineFunction("view_get_hport", 1);
            DefineFunction("view_get_surface_id", 1);
            DefineFunction("view_set_camera", 2);
            DefineFunction("view_set_visible", 2);
            DefineFunction("view_set_xport", 2);
            DefineFunction("view_set_yport", 2);
            DefineFunction("view_set_wport", 2);
            DefineFunction("view_set_hport", 2);
            DefineFunction("view_set_surface_id", 2);
        }
        DefineFunction("switch_accounts_get_accounts", 0);
        DefineFunction("switch_accounts_get_nickname", 1);
        DefineFunction("switch_accounts_open_user", 1);
        DefineFunction("switch_accounts_close_user", 1);
        DefineFunction("switch_accounts_login_user", 1);
        DefineFunction("switch_accounts_is_user_open", 1);
        DefineFunction("switch_accounts_select_account", 3);
        DefineFunction("switch_save_data_mount", 1);
        DefineFunction("switch_save_data_commit", 0);
        DefineFunction("switch_save_data_unmount", 0);
        DefineFunction("switch_language_get_desired_language", 0);
        DefineFunction("switch_get_operation_mode", 0);
        DefineFunction("switch_get_performance_mode", 0);
        DefineFunction("switch_get_performance_config", 1);
        DefineFunction("switch_set_performance_config", 2);
        DefineFunction("switch_theme_set", 1);
        DefineFunction("switch_add_ssl_certificate", 2);
        DefineFunction("switch_set_local_network_mode", 1);
        DefineFunction("switch_controller_show_strap_guide", 0);
        DefineFunction("switch_controller_support_show", 0);
        DefineFunction("switch_controller_support_set_defaults", 0);
        DefineFunction("switch_controller_support_set_all", 8);
        DefineFunction("switch_controller_support_set_show_explain_text", 1);
        DefineFunction("switch_controller_support_set_show_identification_colours", 1);
        DefineFunction("switch_controller_support_set_show_identification_colors", 1);
        DefineFunction("switch_controller_support_set_identification_colour", 2);
        DefineFunction("switch_controller_support_set_identification_color", 2);
        DefineFunction("switch_controller_support_set_left_justify", 1);
        DefineFunction("switch_controller_support_set_permit_joycon_dual", 1);
        DefineFunction("switch_controller_support_set_singleplayer_only", 1);
        DefineFunction("switch_controller_support_set_maintain_connections", 1);
        DefineFunction("switch_controller_support_set_player_min", 1);
        DefineFunction("switch_controller_support_set_player_max", 1);
        DefineFunction("switch_controller_support_set_explain_text", 2);
        DefineFunction("switch_controller_support_get_player_count", 0);
        DefineFunction("switch_controller_support_get_selected_id", 0);
        DefineFunction("switch_controller_joycon_set_holdtype", 1);
        DefineFunction("switch_controller_joycon_get_holdtype", 0);
        DefineFunction("switch_controller_joycon_left_connected", 1);
        DefineFunction("switch_controller_joycon_right_connected", 1);
        DefineFunction("switch_controller_set_supported_styles", 1);
        DefineFunction("switch_controller_get_supported_styles", 0);
        DefineFunction("switch_controller_vibration_permitted", 0);
        DefineFunction("switch_controller_vibrate_hd", 6);
        DefineFunction("switch_controller_acceleration", 2);
        DefineFunction("switch_controller_angular_velocity", 2);
        DefineFunction("switch_controller_angle", 2);
        DefineFunction("switch_controller_direction", 2);
        DefineFunction("switch_controller_get_handheld_activation_mode", 0);
        DefineFunction("switch_controller_set_handheld_activation_mode", 1);
        DefineFunction("switch_controller_is_at_rest", 1);
        DefineFunction("switch_screenshot_disable", 0);
        DefineFunction("switch_screenshot_enable", 0);
        DefineFunction("switch_screenshot_set_orientation", 1);
        DefineFunction("switch_recording_enable", 0);
        DefineFunction("switch_recording_disable", 0);
        DefineFunction("switch_irsensor_set_mode", 2);
        DefineFunction("switch_irsensor_common_config_set_all", 5);
        DefineFunction("switch_irsensor_common_config_set_exposure_time", 2);
        DefineFunction("switch_irsensor_common_config_set_light_target", 2);
        DefineFunction("switch_irsensor_common_config_set_gain", 2);
        DefineFunction("switch_irsensor_common_config_is_negative_image_used", 2);
        DefineFunction("switch_irsensor_cluster_config_set_defaults", 1);
        DefineFunction("switch_irsensor_cluster_config_set_window_of_interest", 5);
        DefineFunction("switch_irsensor_cluster_config_set_object_pixel_count_min", 2);
        DefineFunction("switch_irsensor_cluster_config_set_object_pixel_count_max", 2);
        DefineFunction("switch_irsensor_cluster_config_set_object_intensity_min", 2);
        DefineFunction("switch_irsensor_cluster_config_set_external_light_filtering", 2);
        DefineFunction("switch_irsensor_cluster_create_state_buffer", 1);
        DefineFunction("switch_irsensor_moment_config_set_defaults", 1);
        DefineFunction("switch_irsensor_moment_config_set_window_of_interest", 5);
        DefineFunction("switch_irsensor_moment_config_set_preprocess", 2);
        DefineFunction("switch_irsensor_moment_config_set_preprocess_intensity_threshold", 2);
        DefineFunction("switch_irsensor_moment_create_state_buffer", 1);
        DefineFunction("switch_irsensor_image_config_set_defaults", 1);
        DefineFunction("switch_irsensor_image_config_set_format", 2);
        DefineFunction("switch_irsensor_image_config_set_orig_format", 2);
        DefineFunction("switch_irsensor_image_config_set_trimming_format", 2);
        DefineFunction("switch_irsensor_image_config_set_trimming_start", 3);
        DefineFunction("switch_irsensor_image_config_set_external_light_filtering", 2);
        DefineFunction("switch_irsensor_image_create_state_buffers", 1);
        DefineFunction("switch_irsensor_hand_config_set_mode", 2);
        DefineFunction("switch_irsensor_hand_create_state_buffers", 1);
        DefineFunction("switch_bnvib_load", 1);
        DefineFunction("switch_bnvib_unload", 1);
        DefineFunction("switch_bnvib_get_value", 2);
        DefineFunction("switch_bnvib_is_looping", 1);
        DefineFunction("switch_bnvib_get_loop_end_position", 1);
        DefineFunction("switch_bnvib_get_loop_interval", 1);
        DefineFunction("switch_bnvib_get_loop_start_position", 1);
        DefineFunction("switch_bnvib_get_length", 1);
        DefineFunction("switch_bnvib_get_sampling_rate", 1);
        if (data?.GeneralInfo?.Major == 1 && data?.GeneralInfo?.Build <= 1763)
        {
            DefineFunction("immersion_play_effect", 1, FunctionClassification.Immersion);
            DefineFunction("immersion_stop", 0, FunctionClassification.Immersion);
        }

        // TODO: narrow down the versions and move to the correct places?
        // (these are from 2023.11 fnames)
        if (data?.IsVersionAtLeast(2023) == true)
        {
            DefineFunction("move_and_collide", 3);
            DefineFunction("game_change", 2);
            DefineFunction("is_debug_overlay_open", 0);
            DefineFunction("show_debug_log", 1);
            DefineFunction("dbg_view");
            DefineFunction("dbg_section", 1);
            DefineFunction("dbg_view_delete", 1);
            DefineFunction("dbg_section_delete", 1);
            DefineFunction("dbg_slider");
            DefineFunction("dbg_slider_int");
            DefineFunction("dbg_drop_down");
            DefineFunction("dbg_watch");
            DefineFunction("dbg_text", 1);
            DefineFunction("dbg_sprite");
            DefineFunction("dbg_text_input");
            DefineFunction("dbg_checkbox");
            DefineFunction("dbg_colour");
            DefineFunction("dbg_color");
            DefineFunction("dbg_button");
            DefineFunction("dbg_same_line", 0);
            DefineFunction("dbg_add_font_glyphs");
        }
        if (data?.IsVersionAtLeast(2, 3) == true)
        {
            DefineFunction("scheduler_resolution_set", 1);
            DefineFunction("scheduler_resolution_get", 0);
            DefineFunction("event_perform_async", 2);
            DefineFunction("show_debug_message_ext", 2);
            DefineFunction("ref_create");
            DefineFunction("gif_open");
            DefineFunction("gif_add_surface");
            DefineFunction("gif_save", 2);
            DefineFunction("gif_save_buffer", 1);
            DefineFunction("draw_get_font", 0);
            DefineFunction("draw_get_halign", 0);
            DefineFunction("draw_get_valign", 0);
            DefineFunction("font_get_info", 1);
            DefineFunction("font_cache_glyph", 2);
            DefineFunction("surface_get_format", 1);
            DefineFunction("surface_get_target", 0);
            DefineFunction("surface_get_target_ext", 1);
            DefineFunction("surface_format_is_supported", 1);
            DefineFunction("video_pause", 0);
            DefineFunction("video_resume", 0);
            DefineFunction("video_enable_loop", 1);
            DefineFunction("video_seek_to", 1);
            DefineFunction("video_get_duration", 0);
            DefineFunction("video_get_position", 0);
            DefineFunction("video_get_status", 0);
            DefineFunction("video_get_format", 0);
            DefineFunction("video_is_looping", 0);
            DefineFunction("video_get_volume", 0);
            DefineFunction("display_get_frequency", 0);
            DefineFunction("window_set_showborder", 1);
            DefineFunction("window_get_showborder", 0);
            DefineFunction("window_mouse_set_locked", 1);
            DefineFunction("window_mouse_get_locked", 0);
            DefineFunction("window_mouse_get_delta_x", 0);
            DefineFunction("window_mouse_get_delta_y", 0);
            DefineFunction("audio_play_sound_ext", 1);
            DefineFunction("audio_system_is_available", 0);
            DefineFunction("audio_system_is_initialised", 0);
            DefineFunction("audio_sound_is_playable", 1);
            DefineFunction("audio_sound_loop", 2);
            DefineFunction("audio_sound_get_loop", 1);
            DefineFunction("audio_sound_loop_start", 2);
            DefineFunction("audio_sound_get_loop_start", 1);
            DefineFunction("audio_sound_loop_end", 2);
            DefineFunction("audio_sound_get_loop_end", 1);
            DefineFunction("audio_sync_group_is_paused", 1);
            DefineFunction("audio_group_get_gain", 1);
            DefineFunction("audio_group_get_assets", 1);
            DefineFunction("audio_sound_get_audio_group", 1);
            DefineFunction("sprite_get_info", 1);
            DefineFunction("sprite_get_nineslice", 1);
            DefineFunction("sprite_set_nineslice", 2);
            DefineFunction("sprite_nineslice_create", 0);
            DefineFunction("texturegroup_get_names", 0);
            DefineFunction("texturegroup_load", 1);
            DefineFunction("texturegroup_unload", 1);
            DefineFunction("texturegroup_get_status", 1);
            DefineFunction("texturegroup_set_mode", 3);
            DefineFunction("room_get_info", 1);
            DefineFunction("sprite_add_ext", 5);
            DefineFunction("font_enable_sdf", 2);
            DefineFunction("font_get_sdf_enabled", 1);
            DefineFunction("font_sdf_spread", 2);
            DefineFunction("font_get_sdf_spread", 1);
            DefineFunction("font_enable_effects", 2);
            DefineFunction("script_execute_ext");
            DefineFunction("method_call");
            DefineFunction("asset_get_ids", 1);
            DefineFunction("ds_list_is_map", 2);
            DefineFunction("ds_list_is_list", 2);
            DefineFunction("ds_map_values_to_array");
            DefineFunction("ds_map_keys_to_array");
            DefineFunction("ds_map_is_map", 2);
            DefineFunction("ds_map_is_list", 2);
            DefineFunction("ds_grid_to_mp_grid", 2);
            DefineFunction("effect_create_layer", 6);
            DefineFunction("effect_create_depth", 6);
            DefineFunction("part_type_subimage", 2);
            DefineFunction("part_type_size_x", 5);
            DefineFunction("part_type_size_y", 5);
            DefineFunction("particle_get_info", 1);
            DefineFunction("particle_exists", 1);
            DefineFunction("part_system_color", 3);
            DefineFunction("part_system_colour", 3);
            DefineFunction("part_system_angle", 2);
            DefineFunction("part_system_global_space", 2);
            DefineFunction("part_system_get_info", 1);
            DefineFunction("part_particles_burst", 4);
            DefineFunction("part_emitter_enable", 3);
            DefineFunction("part_emitter_delay", 5);
            DefineFunction("part_emitter_interval", 5);
            DefineFunction("part_emitter_relative", 3);
            DefineFunction("os_set_orientation_lock", 2);
            DefineFunction("gpu_set_depth", 1);
            DefineFunction("gpu_get_depth", 0);
            DefineFunction("gamepad_hat_count", 1);
            DefineFunction("gamepad_hat_value", 2);
            DefineFunction("gamepad_remove_mapping", 1);
            DefineFunction("gamepad_test_mapping", 2);
            DefineFunction("gamepad_get_mapping", 1);
            DefineFunction("gamepad_get_guid", 1);
            DefineFunction("gamepad_set_option", 3);
            DefineFunction("gamepad_get_option", 2);
            DefineFunction("http_get_request_crossorigin", 0);
            DefineFunction("http_set_request_crossorigin", 1);
            DefineFunction("zip_unzip_async", 2);
            DefineFunction("zip_create", 0);
            DefineFunction("zip_add_file", 3);
            DefineFunction("zip_save", 2);
            DefineFunction("uwp_livetile_tile_clear", 0);
            DefineFunction("uwp_livetile_badge_notification", 1);
            DefineFunction("uwp_livetile_badge_clear", 0);
            DefineFunction("uwp_livetile_queue_enable", 1);
            DefineFunction("uwp_secondarytile_pin", 8);
            DefineFunction("uwp_secondarytile_badge_notification", 2);
            DefineFunction("uwp_secondarytile_delete", 1);
            DefineFunction("uwp_secondarytile_badge_clear", 1);
            DefineFunction("uwp_secondarytile_tile_clear", 1);
            DefineFunction("uwp_livetile_notification_begin", 1);
            DefineFunction("uwp_livetile_notification_secondary_begin", 2);
            DefineFunction("uwp_livetile_notification_expiry", 1);
            DefineFunction("uwp_livetile_notification_tag", 1);
            DefineFunction("uwp_livetile_notification_text_add", 1);
            DefineFunction("uwp_livetile_notification_image_add", 1);
            DefineFunction("uwp_livetile_notification_end", 0);
            DefineFunction("uwp_livetile_notification_template_add", 1);
            DefineFunction("uwp_appbar_enable", 1);
            DefineFunction("uwp_appbar_add_element", 7);
            DefineFunction("uwp_appbar_remove_element", 1);
            DefineFunction("uwp_device_touchscreen_available", 0);
            DefineFunction("network_connect_async", 3);
            DefineFunction("network_connect_raw_async", 3);
            DefineFunction("buffer_set_used_size", 2);
            DefineFunction("buffer_copy_stride", 8);
            DefineFunction("buffer_crc32", 3);
            DefineFunction("shader_set_uniform_f_buffer", 4);
            DefineFunction("vertex_format_get_info", 1);
            DefineFunction("vertex_update_buffer_from_buffer", 3);
            DefineFunction("vertex_update_buffer_from_vertex", 3);
            DefineFunction("push_get_application_badge_number", 0);
            DefineFunction("push_set_application_badge_number", 0);
            DefineFunction("skeleton_skin_create", 2);
            DefineFunction("skeleton_attachment_create_colour", 10);
            DefineFunction("skeleton_attachment_create_color", 10);
            DefineFunction("skeleton_attachment_exists", 1);
            DefineFunction("skeleton_attachment_replace", 8);
            DefineFunction("skeleton_attachment_replace_colour", 10);
            DefineFunction("skeleton_attachment_replace_color", 10);
            DefineFunction("skeleton_attachment_destroy", 1);
            DefineFunction("skeleton_slot_colour_set", 3);
            DefineFunction("skeleton_slot_color_set", 3);
            DefineFunction("skeleton_slot_colour_get", 1);
            DefineFunction("skeleton_slot_color_get", 1);
            DefineFunction("skeleton_slot_alpha_get", 1);
            DefineFunction("skeleton_find_slot", 3);
            DefineFunction("skeleton_animation_get_position", 1);
            DefineFunction("skeleton_animation_set_position", 2);
            DefineFunction("skeleton_animation_get_event_frames", 2);
            DefineFunction("skeleton_animation_is_looping", 1);
            DefineFunction("skeleton_animation_is_finished", 1);
            DefineFunction("draw_enable_skeleton_blendmodes", 1);
            DefineFunction("draw_get_enable_skeleton_blendmodes", 0);
            DefineFunction("skeleton_bone_list", 2);
            DefineFunction("skeleton_slot_list", 2);
            DefineFunction("skeleton_slot_data_instance", 1);
            DefineFunction("tileset_get_texture", 1);
            DefineFunction("tileset_get_uvs", 1);
            DefineFunction("tileset_get_name", 1);
            DefineFunction("tileset_get_info", 1);
            DefineFunction("camera_copy_transforms", 2);
            DefineFunction("tag_get_asset_ids", 2);
            DefineFunction("tag_get_assets", 1);
            DefineFunction("asset_get_tags", 1);
            DefineFunction("asset_add_tags", 2);
            DefineFunction("asset_remove_tags", 2);
            DefineFunction("asset_has_tags", 2);
            DefineFunction("asset_has_any_tag", 2);
            DefineFunction("asset_clear_tags", 1);
            DefineFunction("extension_exists", 1);
            DefineFunction("extension_get_version", 1);
            DefineFunction("extension_get_option_count", 1);
            DefineFunction("extension_get_option_names", 1);
            DefineFunction("extension_get_option_value", 2);
            DefineFunction("extension_get_options", 1);
            DefineFunction("layer_sequence_get_instance", 1);
            DefineFunction("layer_sequence_create", 4);
            DefineFunction("layer_sequence_destroy", 1);
            DefineFunction("layer_sequence_exists", 2);
            DefineFunction("layer_sequence_x", 2);
            DefineFunction("layer_sequence_y", 2);
            DefineFunction("layer_sequence_angle", 2);
            DefineFunction("layer_sequence_xscale", 2);
            DefineFunction("layer_sequence_yscale", 2);
            DefineFunction("layer_sequence_headpos", 2);
            DefineFunction("layer_sequence_headdir", 2);
            DefineFunction("layer_sequence_pause", 1);
            DefineFunction("layer_sequence_play", 1);
            DefineFunction("layer_sequence_speedscale", 2);
            DefineFunction("layer_sequence_get_x", 1);
            DefineFunction("layer_sequence_get_y", 1);
            DefineFunction("layer_sequence_get_angle", 1);
            DefineFunction("layer_sequence_get_xscale", 1);
            DefineFunction("layer_sequence_get_yscale", 1);
            DefineFunction("layer_sequence_get_headpos", 1);
            DefineFunction("layer_sequence_get_headdir", 1);
            DefineFunction("layer_sequence_get_sequence", 1);
            DefineFunction("layer_sequence_is_paused", 1);
            DefineFunction("layer_sequence_is_finished", 1);
            DefineFunction("layer_sequence_get_speedscale", 1);
            DefineFunction("layer_sequence_get_length", 1);
            DefineFunction("animcurve_get", 1);
            DefineFunction("animcurve_get_channel", 2);
            DefineFunction("animcurve_get_channel_index", 2);
            DefineFunction("animcurve_channel_evaluate", 2);
            DefineFunction("sequence_create", 0);
            DefineFunction("sequence_destroy", 1);
            DefineFunction("sequence_exists", 1);
            DefineFunction("sequence_get", 1);
            DefineFunction("sequence_keyframe_new", 1);
            DefineFunction("sequence_keyframedata_new", 1);
            DefineFunction("sequence_track_new", 1);
            DefineFunction("sequence_get_objects", 1);
            DefineFunction("sequence_instance_override_object", 3);
            DefineFunction("animcurve_create", 0);
            DefineFunction("animcurve_destroy", 1);
            DefineFunction("animcurve_exists", 1);
            DefineFunction("animcurve_channel_new", 0);
            DefineFunction("animcurve_point_new", 0);
            DefineFunction("fx_create", 1);
            DefineFunction("fx_get_name", 1);
            DefineFunction("fx_get_parameter_names", 1);
            DefineFunction("fx_get_parameter", 2);
            DefineFunction("fx_get_parameters", 1);
            DefineFunction("fx_get_single_layer", 1);
            DefineFunction("fx_set_parameter");
            DefineFunction("fx_set_parameters", 2);
            DefineFunction("fx_set_single_layer", 2);
            DefineFunction("layer_set_fx", 2);
            DefineFunction("layer_get_fx", 1);
            DefineFunction("layer_clear_fx", 1);
            DefineFunction("layer_enable_fx", 2);
            DefineFunction("layer_fx_is_enabled", 1);
            DefineFunction("gc_collect", 0);
            DefineFunction("gc_enable", 1);
            DefineFunction("gc_is_enabled", 0);
            DefineFunction("gc_get_stats", 0);
            DefineFunction("gc_target_frame_time", 1);
            DefineFunction("gc_get_target_frame_time", 0);
            DefineFunction("weak_ref_create", 1);
            DefineFunction("weak_ref_alive", 1);
            DefineFunction("weak_ref_any_alive", 1);
            DefineFunction("time_source_create", 4);
            DefineFunction("time_source_destroy", 1);
            DefineFunction("time_source_start", 1);
            DefineFunction("time_source_stop", 1);
            DefineFunction("time_source_pause", 1);
            DefineFunction("time_source_resume", 1);
            DefineFunction("time_source_reset", 1);
            DefineFunction("time_source_reconfigure", 4);
            DefineFunction("time_source_get_period", 1);
            DefineFunction("time_source_get_reps_completed", 1);
            DefineFunction("time_source_get_reps_remaining", 1);
            DefineFunction("time_source_get_units", 1);
            DefineFunction("time_source_get_time_remaining", 1);
            DefineFunction("time_source_get_state", 1);
            DefineFunction("time_source_get_parent", 1);
            DefineFunction("time_source_get_children", 1);
            DefineFunction("time_source_exists", 1);
            DefineFunction("time_seconds_to_bpm", 1);
            DefineFunction("time_bpm_to_seconds", 1);
            DefineFunction("call_later", 3);
            DefineFunction("call_cancel", 1);
            DefineFunction("rollback_use_manual_start", 0);
            DefineFunction("rollback_use_late_join", 0);
            DefineFunction("rollback_define_player");
            DefineFunction("rollback_define_input", 1);
            DefineFunction("rollback_define_mock_input", 2);
            DefineFunction("rollback_define_input_frame_delay", 1);
            DefineFunction("rollback_define_extra_network_latency", 1);
            DefineFunction("rollback_create_game");
            DefineFunction("rollback_join_game");
            DefineFunction("rollback_start_game", 0);
            DefineFunction("rollback_leave_game", 0);
            DefineFunction("rollback_get_input");
            DefineFunction("rollback_chat");
            DefineFunction("rollback_use_player_prefs");
            DefineFunction("rollback_set_player_prefs", 1);
            DefineFunction("rollback_get_player_prefs");
            DefineFunction("rollback_get_info");
            DefineFunction("rollback_use_random_input", 1);
            DefineFunction("rollback_display_events", 1);
            DefineFunction("rollback_sync_on_frame", 0);
            DefineFunction("wallpaper_set_config", 1);
            DefineFunction("wallpaper_set_subscriptions", 1);
            DefineFunction("audio_bus_create", 0);
            DefineFunction("audio_effect_create", 1);
            DefineFunction("audio_emitter_bus", 2);
            DefineFunction("audio_emitter_get_bus", 1);
            DefineFunction("audio_bus_get_emitters", 1);
            DefineFunction("audio_bus_clear_emitters", 1);
            DefineFunction("lin_to_db", 1);
            DefineFunction("db_to_lin", 1);
        }

        // List of constants
        Constants = new(1024);
        Constants["self"] = -1.0;
        Constants["other"] = -2.0;
        Constants["all"] = -3.0;
        Constants["noone"] = -4.0;
        Constants["global"] = -5.0;
        Constants["pi"] = 3.1415926535897931;
        Constants["pr_pointlist"] = 1.0;
        Constants["pr_linelist"] = 2.0;
        Constants["pr_linestrip"] = 3.0;
        Constants["pr_trianglelist"] = 4.0;
        Constants["pr_trianglestrip"] = 5.0;
        Constants["pr_trianglefan"] = 6.0;
        Constants["c_aqua"] = 16776960.0;
        Constants["c_black"] = 0.0;
        Constants["c_blue"] = 16711680.0;
        Constants["c_dkgray"] = 4210752.0;
        Constants["c_fuchsia"] = 16711935.0;
        Constants["c_gray"] = 8421504.0;
        Constants["c_green"] = 32768.0;
        Constants["c_lime"] = 65280.0;
        Constants["c_ltgray"] = 12632256.0;
        Constants["c_maroon"] = 128.0;
        Constants["c_navy"] = 8388608.0;
        Constants["c_olive"] = 32896.0;
        Constants["c_purple"] = 8388736.0;
        Constants["c_red"] = 255.0;
        Constants["c_silver"] = 12632256.0;
        Constants["c_teal"] = 8421376.0;
        Constants["c_white"] = 16777215.0;
        Constants["c_yellow"] = 65535.0;
        Constants["c_orange"] = 4235519.0;
        if (data?.GeneralInfo?.Major < 2)
        {
            Constants["bm_complex"] = -1.0;
        }
        Constants["bm_normal"] = 0.0;
        Constants["bm_add"] = 1.0;
        Constants["bm_max"] = 2.0;
        Constants["bm_subtract"] = 3.0;
        Constants["bm_min"] = 4.0;
        Constants["bm_reverse_subtract"] = 5.0;
        Constants["bm_zero"] = 1.0;
        Constants["bm_one"] = 2.0;
        Constants["bm_src_color"] = 3.0;
        Constants["bm_inv_src_color"] = 4.0;
        Constants["bm_src_colour"] = 3.0;
        Constants["bm_inv_src_colour"] = 4.0;
        Constants["bm_src_alpha"] = 5.0;
        Constants["bm_inv_src_alpha"] = 6.0;
        Constants["bm_dest_alpha"] = 7.0;
        Constants["bm_inv_dest_alpha"] = 8.0;
        Constants["bm_dest_color"] = 9.0;
        Constants["bm_inv_dest_color"] = 10.0;
        Constants["bm_dest_colour"] = 9.0;
        Constants["bm_inv_dest_colour"] = 10.0;
        Constants["bm_src_alpha_sat"] = 11.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["tf_point"] = 0.0;
            Constants["tf_linear"] = 1.0;
            Constants["tf_anisotropic"] = 2.0;
            Constants["mip_off"] = 0.0;
            Constants["mip_on"] = 1.0;
            Constants["mip_markedonly"] = 2.0;
        }
        Constants["audio_falloff_none"] = 0.0;
        Constants["audio_falloff_inverse_distance"] = 1.0;
        Constants["audio_falloff_inverse_distance_clamped"] = 2.0;
        Constants["audio_falloff_linear_distance"] = 3.0;
        Constants["audio_falloff_linear_distance_clamped"] = 4.0;
        Constants["audio_falloff_exponent_distance"] = 5.0;
        Constants["audio_falloff_exponent_distance_clamped"] = 6.0;
        Constants["audio_falloff_inverse_distance_scaled"] = 7.0;
        Constants["audio_falloff_exponent_distance_scaled"] = 8.0;
        Constants["audio_old_system"] = 0.0;
        Constants["audio_new_system"] = 1.0;
        Constants["audio_mono"] = 0.0;
        Constants["audio_stereo"] = 1.0;
        Constants["audio_3d"] = 2.0;
        Constants["fa_left"] = 0.0;
        Constants["fa_center"] = 1.0;
        Constants["fa_right"] = 2.0;
        Constants["fa_top"] = 0.0;
        Constants["fa_middle"] = 1.0;
        Constants["fa_bottom"] = 2.0;
        Constants["mb_any"] = -1.0;
        Constants["mb_none"] = 0.0;
        Constants["mb_left"] = 1.0;
        Constants["mb_right"] = 2.0;
        Constants["mb_middle"] = 3.0;
        Constants["vk_nokey"] = 0.0;
        Constants["vk_anykey"] = 1.0;
        Constants["vk_enter"] = 13.0;
        Constants["vk_return"] = 13.0;
        Constants["vk_shift"] = 16.0;
        Constants["vk_control"] = 17.0;
        Constants["vk_alt"] = 18.0;
        Constants["vk_escape"] = 27.0;
        Constants["vk_space"] = 32.0;
        Constants["vk_backspace"] = 8.0;
        Constants["vk_tab"] = 9.0;
        Constants["vk_pause"] = 19.0;
        Constants["vk_printscreen"] = 44.0;
        Constants["vk_left"] = 37.0;
        Constants["vk_right"] = 39.0;
        Constants["vk_up"] = 38.0;
        Constants["vk_down"] = 40.0;
        Constants["vk_home"] = 36.0;
        Constants["vk_end"] = 35.0;
        Constants["vk_delete"] = 46.0;
        Constants["vk_insert"] = 45.0;
        Constants["vk_pageup"] = 33.0;
        Constants["vk_pagedown"] = 34.0;
        Constants["vk_f1"] = 112.0;
        Constants["vk_f2"] = 113.0;
        Constants["vk_f3"] = 114.0;
        Constants["vk_f4"] = 115.0;
        Constants["vk_f5"] = 116.0;
        Constants["vk_f6"] = 117.0;
        Constants["vk_f7"] = 118.0;
        Constants["vk_f8"] = 119.0;
        Constants["vk_f9"] = 120.0;
        Constants["vk_f10"] = 121.0;
        Constants["vk_f11"] = 122.0;
        Constants["vk_f12"] = 123.0;
        Constants["vk_numpad0"] = 96.0;
        Constants["vk_numpad1"] = 97.0;
        Constants["vk_numpad2"] = 98.0;
        Constants["vk_numpad3"] = 99.0;
        Constants["vk_numpad4"] = 100.0;
        Constants["vk_numpad5"] = 101.0;
        Constants["vk_numpad6"] = 102.0;
        Constants["vk_numpad7"] = 103.0;
        Constants["vk_numpad8"] = 104.0;
        Constants["vk_numpad9"] = 105.0;
        Constants["vk_divide"] = 111.0;
        Constants["vk_multiply"] = 106.0;
        Constants["vk_subtract"] = 109.0;
        Constants["vk_add"] = 107.0;
        Constants["vk_decimal"] = 110.0;
        Constants["vk_lshift"] = 160.0;
        Constants["vk_lcontrol"] = 162.0;
        Constants["vk_lalt"] = 164.0;
        Constants["vk_rshift"] = 161.0;
        Constants["vk_rcontrol"] = 163.0;
        Constants["vk_ralt"] = 165.0;
        Constants["gp_face1"] = 32769.0;
        Constants["gp_face2"] = 32770.0;
        Constants["gp_face3"] = 32771.0;
        Constants["gp_face4"] = 32772.0;
        Constants["gp_shoulderl"] = 32773.0;
        Constants["gp_shoulderr"] = 32774.0;
        Constants["gp_shoulderlb"] = 32775.0;
        Constants["gp_shoulderrb"] = 32776.0;
        Constants["gp_select"] = 32777.0;
        Constants["gp_start"] = 32778.0;
        Constants["gp_stickl"] = 32779.0;
        Constants["gp_stickr"] = 32780.0;
        Constants["gp_padu"] = 32781.0;
        Constants["gp_padd"] = 32782.0;
        Constants["gp_padl"] = 32783.0;
        Constants["gp_padr"] = 32784.0;
        Constants["gp_axislh"] = 32785.0;
        Constants["gp_axislv"] = 32786.0;
        Constants["gp_axisrh"] = 32787.0;
        Constants["gp_axisrv"] = 32788.0;
        Constants["gp_axis_acceleration_x"] = 32789.0;
        Constants["gp_axis_acceleration_y"] = 32790.0;
        Constants["gp_axis_acceleration_z"] = 32791.0;
        Constants["gp_axis_angular_velocity_x"] = 32792.0;
        Constants["gp_axis_angular_velocity_y"] = 32793.0;
        Constants["gp_axis_angular_velocity_z"] = 32794.0;
        Constants["gp_axis_orientation_x"] = 32795.0;
        Constants["gp_axis_orientation_y"] = 32796.0;
        Constants["gp_axis_orientation_z"] = 32797.0;
        Constants["gp_axis_orientation_w"] = 32798.0;
        Constants["gp_home"] = 32799.0;
        Constants["gp_extra1"] = 32800.0;
        Constants["gp_extra2"] = 32801.0;
        Constants["gp_extra3"] = 32802.0;
        Constants["gp_extra4"] = 32803.0;
        Constants["gp_paddler"] = 32804.0;
        Constants["gp_paddlel"] = 32805.0;
        Constants["gp_paddlerb"] = 32806.0;
        Constants["gp_paddlelb"] = 32807.0;
        Constants["gp_touchpadbutton"] = 32808.0;
        Constants["gp_extra5"] = 32809.0;
        Constants["gp_extra6"] = 32810.0;
        Constants["ev_create"] = 0.0;
        Constants["ev_destroy"] = 1.0;
        Constants["ev_alarm"] = 2.0;
        Constants["ev_step"] = 3.0;
        Constants["ev_collision"] = 4.0;
        Constants["ev_keyboard"] = 5.0;
        Constants["ev_mouse"] = 6.0;
        Constants["ev_other"] = 7.0;
        Constants["ev_draw"] = 8.0;
        Constants["ev_keypress"] = 9.0;
        Constants["ev_keyrelease"] = 10.0;
        Constants["ev_trigger"] = 11.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["ev_cleanup"] = 11.0;
            Constants["ev_gesture"] = 13.0;
            Constants["ev_pre_create"] = 14.0;
        }
        Constants["ev_left_button"] = 0.0;
        Constants["ev_right_button"] = 1.0;
        Constants["ev_middle_button"] = 2.0;
        Constants["ev_no_button"] = 3.0;
        Constants["ev_left_press"] = 4.0;
        Constants["ev_right_press"] = 5.0;
        Constants["ev_middle_press"] = 6.0;
        Constants["ev_left_release"] = 7.0;
        Constants["ev_right_release"] = 8.0;
        Constants["ev_middle_release"] = 9.0;
        Constants["ev_mouse_enter"] = 10.0;
        Constants["ev_mouse_leave"] = 11.0;
        Constants["ev_global_press"] = 12.0;
        Constants["ev_global_release"] = 13.0;
        Constants["ev_joystick1_left"] = 16.0;
        Constants["ev_joystick1_right"] = 17.0;
        Constants["ev_joystick1_up"] = 18.0;
        Constants["ev_joystick1_down"] = 19.0;
        Constants["ev_joystick1_button1"] = 21.0;
        Constants["ev_joystick1_button2"] = 22.0;
        Constants["ev_joystick1_button3"] = 23.0;
        Constants["ev_joystick1_button4"] = 24.0;
        Constants["ev_joystick1_button5"] = 25.0;
        Constants["ev_joystick1_button6"] = 26.0;
        Constants["ev_joystick1_button7"] = 27.0;
        Constants["ev_joystick1_button8"] = 28.0;
        Constants["ev_joystick2_left"] = 31.0;
        Constants["ev_joystick2_right"] = 32.0;
        Constants["ev_joystick2_up"] = 33.0;
        Constants["ev_joystick2_down"] = 34.0;
        Constants["ev_joystick2_button1"] = 36.0;
        Constants["ev_joystick2_button2"] = 37.0;
        Constants["ev_joystick2_button3"] = 38.0;
        Constants["ev_joystick2_button4"] = 39.0;
        Constants["ev_joystick2_button5"] = 40.0;
        Constants["ev_joystick2_button6"] = 41.0;
        Constants["ev_joystick2_button7"] = 42.0;
        Constants["ev_joystick2_button8"] = 43.0;
        Constants["ev_global_left_button"] = 50.0;
        Constants["ev_global_right_button"] = 51.0;
        Constants["ev_global_middle_button"] = 52.0;
        Constants["ev_global_left_press"] = 53.0;
        Constants["ev_global_right_press"] = 54.0;
        Constants["ev_global_middle_press"] = 55.0;
        Constants["ev_global_left_release"] = 56.0;
        Constants["ev_global_right_release"] = 57.0;
        Constants["ev_global_middle_release"] = 58.0;
        Constants["ev_mouse_wheel_up"] = 60.0;
        Constants["ev_mouse_wheel_down"] = 61.0;
        Constants["ev_outside"] = 0.0;
        Constants["ev_boundary"] = 1.0;
        Constants["ev_game_start"] = 2.0;
        Constants["ev_game_end"] = 3.0;
        Constants["ev_room_start"] = 4.0;
        Constants["ev_room_end"] = 5.0;
        Constants["ev_no_more_lives"] = 6.0;
        Constants["ev_animation_end"] = 7.0;
        Constants["ev_end_of_path"] = 8.0;
        Constants["ev_no_more_health"] = 9.0;
        Constants["ev_user0"] = 10.0;
        Constants["ev_user1"] = 11.0;
        Constants["ev_user2"] = 12.0;
        Constants["ev_user3"] = 13.0;
        Constants["ev_user4"] = 14.0;
        Constants["ev_user5"] = 15.0;
        Constants["ev_user6"] = 16.0;
        Constants["ev_user7"] = 17.0;
        Constants["ev_user8"] = 18.0;
        Constants["ev_user9"] = 19.0;
        Constants["ev_user10"] = 20.0;
        Constants["ev_user11"] = 21.0;
        Constants["ev_user12"] = 22.0;
        Constants["ev_user13"] = 23.0;
        Constants["ev_user14"] = 24.0;
        Constants["ev_user15"] = 25.0;
        Constants["ev_close_button"] = 30.0;
        Constants["ev_step_normal"] = 0.0;
        Constants["ev_step_begin"] = 1.0;
        Constants["ev_step_end"] = 2.0;
        Constants["ev_gui"] = 64.0;
        Constants["ev_draw_normal"] = 0.0;
        Constants["ev_draw_begin"] = 72.0;
        Constants["ev_draw_end"] = 73.0;
        Constants["ev_gui_begin"] = 74.0;
        Constants["ev_gui_end"] = 75.0;
        Constants["ev_draw_pre"] = 76.0;
        Constants["ev_draw_post"] = 77.0;
        Constants["ev_outside_view0"] = 40.0;
        Constants["ev_outside_view1"] = 41.0;
        Constants["ev_outside_view2"] = 42.0;
        Constants["ev_outside_view3"] = 43.0;
        Constants["ev_outside_view4"] = 44.0;
        Constants["ev_outside_view5"] = 45.0;
        Constants["ev_outside_view6"] = 46.0;
        Constants["ev_outside_view7"] = 47.0;
        Constants["ev_boundary_view0"] = 50.0;
        Constants["ev_boundary_view1"] = 51.0;
        Constants["ev_boundary_view2"] = 52.0;
        Constants["ev_boundary_view3"] = 53.0;
        Constants["ev_boundary_view4"] = 54.0;
        Constants["ev_boundary_view5"] = 55.0;
        Constants["ev_boundary_view6"] = 56.0;
        Constants["ev_boundary_view7"] = 57.0;
        Constants["ev_animation_update"] = 58.0;
        Constants["ev_animation_event"] = 59.0;
        Constants["ev_web_image_load"] = 60.0;
        Constants["ev_web_sound_load"] = 61.0;
        Constants["ev_web_async"] = 62.0;
        Constants["ev_dialog_async"] = 63.0;
        Constants["ev_web_iap"] = 66.0;
        Constants["ev_web_cloud"] = 67.0;
        Constants["ev_web_networking"] = 68.0;
        Constants["ev_web_steam"] = 69.0;
        Constants["ev_social"] = 70.0;
        Constants["ev_push_notification"] = 71.0;
        Constants["ev_audio_recording"] = 73.0;
        Constants["ev_audio_playback"] = 74.0;
        Constants["ev_system_event"] = 75.0;
        Constants["ev_broadcast_message"] = 76.0;
        Constants["ev_audio_playback_ended"] = 80.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["ev_gesture_tap"] = 0.0;
            Constants["ev_gesture_double_tap"] = 1.0;
            Constants["ev_gesture_drag_start"] = 2.0;
            Constants["ev_gesture_dragging"] = 3.0;
            Constants["ev_gesture_drag_end"] = 4.0;
            Constants["ev_gesture_flick"] = 5.0;
            Constants["ev_gesture_pinch_start"] = 6.0;
            Constants["ev_gesture_pinch_in"] = 7.0;
            Constants["ev_gesture_pinch_out"] = 8.0;
            Constants["ev_gesture_pinch_end"] = 9.0;
            Constants["ev_gesture_rotate_start"] = 10.0;
            Constants["ev_gesture_rotating"] = 11.0;
            Constants["ev_gesture_rotate_end"] = 12.0;
            Constants["ev_global_gesture_tap"] = 64.0;
            Constants["ev_global_gesture_double_tap"] = 65.0;
            Constants["ev_global_gesture_drag_start"] = 66.0;
            Constants["ev_global_gesture_dragging"] = 67.0;
            Constants["ev_global_gesture_drag_end"] = 68.0;
            Constants["ev_global_gesture_flick"] = 69.0;
            Constants["ev_global_gesture_pinch_start"] = 70.0;
            Constants["ev_global_gesture_pinch_in"] = 71.0;
            Constants["ev_global_gesture_pinch_out"] = 72.0;
            Constants["ev_global_gesture_pinch_end"] = 73.0;
            Constants["ev_global_gesture_rotate_start"] = 74.0;
            Constants["ev_global_gesture_rotating"] = 75.0;
            Constants["ev_global_gesture_rotate_end"] = 76.0;
        }
        Constants["ev_async_web_image_load"] = 60.0;
        Constants["ev_async_web"] = 62.0;
        Constants["ev_async_dialog"] = 63.0;
        Constants["ev_async_web_iap"] = 66.0;
        Constants["ev_async_web_cloud"] = 67.0;
        Constants["ev_async_web_networking"] = 68.0;
        Constants["ev_async_web_steam"] = 69.0;
        Constants["ev_async_social"] = 70.0;
        Constants["ev_async_push_notification"] = 71.0;
        Constants["ev_async_save_load"] = 72.0;
        Constants["ev_async_audio_recording"] = 73.0;
        Constants["ev_async_audio_playback"] = 74.0;
        Constants["ev_async_system_event"] = 75.0;
        Constants["ev_async_audio_playback_ended"] = 80.0;
        Constants["ty_real"] = 0.0;
        Constants["ty_string"] = 1.0;
        Constants["dll_cdecl"] = 0.0;
        Constants["dll_stdcall"] = 1.0;
        Constants["fa_readonly"] = 1.0;
        Constants["fa_hidden"] = 2.0;
        Constants["fa_sysfile"] = 4.0;
        Constants["fa_volumeid"] = 8.0;
        Constants["fa_directory"] = 16.0;
        Constants["fa_archive"] = 32.0;
        Constants["cr_default"] = 0.0;
        Constants["cr_none"] = -1.0;
        Constants["cr_arrow"] = -2.0;
        Constants["cr_cross"] = -3.0;
        Constants["cr_beam"] = -4.0;
        Constants["cr_size_nesw"] = -6.0;
        Constants["cr_size_ns"] = -7.0;
        Constants["cr_size_nwse"] = -8.0;
        Constants["cr_size_we"] = -9.0;
        Constants["cr_uparrow"] = -10.0;
        Constants["cr_hourglass"] = -11.0;
        Constants["cr_drag"] = -12.0;
        Constants["cr_appstart"] = -19.0;
        Constants["cr_handpoint"] = -21.0;
        Constants["cr_size_all"] = -22.0;
        Constants["pt_shape_pixel"] = 0.0;
        Constants["pt_shape_disk"] = 1.0;
        Constants["pt_shape_square"] = 2.0;
        Constants["pt_shape_line"] = 3.0;
        Constants["pt_shape_star"] = 4.0;
        Constants["pt_shape_circle"] = 5.0;
        Constants["pt_shape_ring"] = 6.0;
        Constants["pt_shape_sphere"] = 7.0;
        Constants["pt_shape_flare"] = 8.0;
        Constants["pt_shape_spark"] = 9.0;
        Constants["pt_shape_explosion"] = 10.0;
        Constants["pt_shape_cloud"] = 11.0;
        Constants["pt_shape_smoke"] = 12.0;
        Constants["pt_shape_snow"] = 13.0;
        Constants["ps_distr_linear"] = 0.0;
        Constants["ps_distr_gaussian"] = 1.0;
        Constants["ps_distr_invgaussian"] = 2.0;
        Constants["ps_shape_rectangle"] = 0.0;
        Constants["ps_shape_ellipse"] = 1.0;
        Constants["ps_shape_diamond"] = 2.0;
        Constants["ps_shape_line"] = 3.0;
        Constants["ps_force_constant"] = 0.0;
        Constants["ps_force_linear"] = 1.0;
        Constants["ps_force_quadratic"] = 2.0;
        Constants["ps_deflect_vertical"] = 0.0;
        Constants["ps_deflect_horizontal"] = 1.0;
        Constants["ps_change_all"] = 0.0;
        Constants["ps_change_shape"] = 1.0;
        Constants["ps_change_motion"] = 2.0;
        Constants["ef_explosion"] = 0.0;
        Constants["ef_ring"] = 1.0;
        Constants["ef_ellipse"] = 2.0;
        Constants["ef_firework"] = 3.0;
        Constants["ef_smoke"] = 4.0;
        Constants["ef_smokeup"] = 5.0;
        Constants["ef_star"] = 6.0;
        Constants["ef_spark"] = 7.0;
        Constants["ef_flare"] = 8.0;
        Constants["ef_cloud"] = 9.0;
        Constants["ef_rain"] = 10.0;
        Constants["ef_snow"] = 11.0;
        Constants["display_landscape"] = 0.0;
        Constants["display_portrait"] = 1.0;
        Constants["display_landscape_flipped"] = 2.0;
        Constants["display_portrait_flipped"] = 3.0;
        Constants["os_unknown"] = -1.0;
        Constants["os_win32"] = 0.0;
        Constants["os_windows"] = 0.0;
        Constants["os_macosx"] = 1.0;
        if (data?.GeneralInfo?.Major < 2)
        {
            Constants["os_psp"] = 2.0;
        }
        Constants["os_ios"] = 3.0;
        Constants["os_android"] = 4.0;
        Constants["os_symbian"] = 5.0;
        Constants["os_linux"] = 6.0;
        Constants["os_winphone"] = 7.0;
        Constants["os_tizen"] = 8.0;
        Constants["os_win8native"] = 9.0;
        Constants["os_wiiu"] = 10.0;
        Constants["os_3ds"] = 11.0;
        Constants["os_psvita"] = 12.0;
        Constants["os_bb10"] = 13.0;
        Constants["os_ps4"] = 14.0;
        Constants["os_xboxone"] = 15.0;
        Constants["os_ps3"] = 16.0;
        Constants["os_xbox360"] = 17.0;
        Constants["os_uwp"] = 18.0;
        Constants["os_switch_beta"] = 20.0; // This is what NXTALE identifies itself as. It likely was an old version name(?) Unfortunately, it shares an id with tvos. However, since this tool is written for Undertale, we give it priority over tvos.
        Constants["os_tvos"] = 20.0;
        Constants["os_switch"] = 21.0;
        Constants["os_ps5"] = 22.0;
        Constants["os_gdk"] = 23.0;
        Constants["os_gxgames"] = 24.0;
        Constants["os_switch2"] = 25.0;
        Constants["os_llvm_win32"] = 65536.0;
        Constants["os_llvm_macosx"] = 65537.0;
        Constants["os_llvm_psp"] = 65538.0;
        Constants["os_llvm_ios"] = 65539.0;
        Constants["os_llvm_android"] = 65540.0;
        Constants["os_llvm_symbian"] = 65541.0;
        Constants["os_llvm_linux"] = 65542.0;
        Constants["os_llvm_winphone"] = 65543.0;
        Constants["browser_not_a_browser"] = -1.0;
        Constants["browser_unknown"] = 0.0;
        Constants["browser_ie"] = 1.0;
        Constants["browser_firefox"] = 2.0;
        Constants["browser_chrome"] = 3.0;
        Constants["browser_safari"] = 4.0;
        Constants["browser_safari_mobile"] = 5.0;
        Constants["browser_opera"] = 6.0;
        Constants["browser_android_default"] = 7.0;
        Constants["browser_windows_store"] = 8.0;
        Constants["browser_tizen"] = 9.0;
        Constants["browser_ie_mobile"] = 10.0;
        Constants["browser_edge"] = 11.0;
        Constants["asset_unknown"] = -1.0;
        Constants["asset_object"] = 0.0;
        Constants["asset_sprite"] = 1.0;
        Constants["asset_sound"] = 2.0;
        Constants["asset_room"] = 3.0;
        if (data?.GeneralInfo?.Major < 2)
        {
            Constants["asset_background"] = 4.0;
        }
        else
        {
            Constants["asset_tiles"] = 9.0;
        }
        Constants["asset_path"] = 5.0;
        Constants["asset_script"] = 6.0;
        Constants["asset_font"] = 7.0;
        Constants["asset_timeline"] = 8.0;
        Constants["asset_shader"] = 10.0;
        Constants["device_ios_unknown"] = -1.0;
        Constants["device_ios_iphone"] = 0.0;
        Constants["device_ios_iphone_retina"] = 1.0;
        Constants["device_ios_ipad"] = 2.0;
        Constants["device_ios_ipad_retina"] = 3.0;
        Constants["device_ios_iphone5"] = 4.0;
        Constants["device_ios_iphone6"] = 5.0;
        Constants["device_ios_iphone6plus"] = 6.0;
        Constants["device_ios_iphone6s"] = 7.0;
        Constants["device_ios_iphone6splus"] = 8.0;
        Constants["device_emulator"] = 256.0;
        Constants["device_tablet"] = 2.0;
        Constants["of_challenge_win"] = 0.0;
        Constants["of_challenge_lose"] = 1.0;
        Constants["of_challenge_tie"] = 2.0;
        Constants["leaderboard_type_number"] = 0.0;
        Constants["leaderboard_type_time_mins_secs"] = 1.0;
        Constants["phy_joint_anchor_1_x"] = 0.0;
        Constants["phy_joint_anchor_1_y"] = 1.0;
        Constants["phy_joint_anchor_2_x"] = 2.0;
        Constants["phy_joint_anchor_2_y"] = 3.0;
        Constants["phy_joint_reaction_force_x"] = 4.0;
        Constants["phy_joint_reaction_force_y"] = 5.0;
        Constants["phy_joint_reaction_torque"] = 6.0;
        Constants["phy_joint_motor_speed"] = 7.0;
        Constants["phy_joint_angle"] = 8.0;
        Constants["phy_joint_motor_torque"] = 9.0;
        Constants["phy_joint_max_motor_torque"] = 10.0;
        Constants["phy_joint_translation"] = 11.0;
        Constants["phy_joint_speed"] = 12.0;
        Constants["phy_joint_motor_force"] = 13.0;
        Constants["phy_joint_max_motor_force"] = 14.0;
        Constants["phy_joint_length_1"] = 15.0;
        Constants["phy_joint_length_2"] = 16.0;
        Constants["phy_joint_damping_ratio"] = 17.0;
        Constants["phy_joint_frequency"] = 18.0;
        Constants["phy_joint_lower_angle_limit"] = 19.0;
        Constants["phy_joint_upper_angle_limit"] = 20.0;
        Constants["phy_joint_angle_limits"] = 21.0;
        Constants["phy_joint_max_length"] = 22.0;
        Constants["phy_joint_max_torque"] = 23.0;
        Constants["phy_joint_max_force"] = 24.0;
        Constants["phy_debug_render_shapes"] = 1.0;
        Constants["phy_debug_render_joints"] = 2.0;
        Constants["phy_debug_render_coms"] = 4.0;
        Constants["phy_debug_render_aabb"] = 8.0;
        Constants["phy_debug_render_obb"] = 16.0;
        Constants["phy_debug_render_core_shapes"] = 32.0;
        Constants["phy_debug_render_collision_pairs"] = 64.0;
        Constants["phy_particle_flag_water"] = 0.0;
        Constants["phy_particle_flag_zombie"] = 2.0;
        Constants["phy_particle_flag_wall"] = 4.0;
        Constants["phy_particle_flag_spring"] = 8.0;
        Constants["phy_particle_flag_elastic"] = 16.0;
        Constants["phy_particle_flag_viscous"] = 32.0;
        Constants["phy_particle_flag_powder"] = 64.0;
        Constants["phy_particle_flag_tensile"] = 128.0;
        Constants["phy_particle_flag_colourmixing"] = 256.0;
        Constants["phy_particle_group_flag_solid"] = 1.0;
        Constants["phy_particle_group_flag_rigid"] = 2.0;
        Constants["phy_particle_data_flag_typeflags"] = 1.0;
        Constants["phy_particle_data_flag_position"] = 2.0;
        Constants["phy_particle_data_flag_velocity"] = 4.0;
        Constants["phy_particle_data_flag_colour"] = 8.0;
        Constants["phy_particle_data_flag_category"] = 16.0;
        Constants["achievement_our_info"] = 1002.0;
        Constants["achievement_friends_info"] = 1003.0;
        Constants["achievement_leaderboard_info"] = 1004.0;
        Constants["achievement_achievement_info"] = 1005.0;
        Constants["achievement_filter_all_players"] = 0.0;
        Constants["achievement_filter_friends_only"] = 1.0;
        Constants["achievement_filter_favorites_only"] = 2.0;
        Constants["achievement_filter_friends_alt"] = 3.0;
        Constants["achievement_filter_favorites_alt"] = 4.0;
        Constants["achievement_type_achievement_challenge"] = 0.0;
        Constants["achievement_type_score_challenge"] = 1.0;
        Constants["achievement_pic_loaded"] = 1006.0;
        Constants["achievement_challenge_completed"] = 1007.0;
        Constants["achievement_challenge_completed_by_remote"] = 1008.0;
        Constants["achievement_challenge_received"] = 1009.0;
        Constants["achievement_challenge_list_received"] = 1010.0;
        Constants["achievement_challenge_launched"] = 1011.0;
        Constants["achievement_player_info"] = 1012.0;
        Constants["achievement_purchase_info"] = 1013.0;
        Constants["achievement_msg_result"] = 1014.0;
        Constants["achievement_stat_event"] = 1015.0;
        Constants["achievement_show_ui"] = 0.0;
        Constants["achievement_show_profile"] = 1.0;
        Constants["achievement_show_leaderboard"] = 2.0;
        Constants["achievement_show_achievement"] = 3.0;
        Constants["achievement_show_bank"] = 4.0;
        Constants["achievement_show_friend_picker"] = 5.0;
        Constants["achievement_show_purchase_prompt"] = 6.0;
        Constants["buffer_fixed"] = 0.0;
        Constants["buffer_grow"] = 1.0;
        Constants["buffer_wrap"] = 2.0;
        Constants["buffer_fast"] = 3.0;
        Constants["buffer_vbuffer"] = 4.0;
        Constants["buffer_network"] = 5.0;
        Constants["buffer_u8"] = 1.0;
        Constants["buffer_s8"] = 2.0;
        Constants["buffer_u16"] = 3.0;
        Constants["buffer_s16"] = 4.0;
        Constants["buffer_u32"] = 5.0;
        Constants["buffer_s32"] = 6.0;
        Constants["buffer_f16"] = 7.0;
        Constants["buffer_f32"] = 8.0;
        Constants["buffer_f64"] = 9.0;
        Constants["buffer_bool"] = 10.0;
        Constants["buffer_string"] = 11.0;
        Constants["buffer_u64"] = 12.0;
        Constants["buffer_text"] = 13.0;
        Constants["buffer_seek_start"] = 0.0;
        Constants["buffer_seek_relative"] = 1.0;
        Constants["buffer_seek_end"] = 2.0;
        Constants["buffer_surface_copy"] = 0.0;
        Constants["network_socket_tcp"] = 0.0;
        Constants["network_socket_udp"] = 1.0;
        Constants["network_socket_bluetooth"] = 2.0;
        Constants["network_socket_tcp_psn"] = 3.0;
        Constants["network_socket_udp_psn"] = 4.0;
        Constants["network_socket_udp_switch"] = 5.0;
        Constants["network_socket_ws"] = 6.0;
        Constants["network_socket_wss"] = 7.0;
        Constants["network_type_connect"] = 1.0;
        Constants["network_type_disconnect"] = 2.0;
        Constants["network_type_data"] = 3.0;
        Constants["network_type_non_blocking_connect"] = 4.0;
        Constants["network_config_connect_timeout"] = 0.0;
        Constants["network_config_use_non_blocking_socket"] = 1.0;
        Constants["network_config_enable_reliable_udp"] = 2.0;
        Constants["network_config_disable_reliable_udp"] = 3.0;
        Constants["network_config_avoid_time_wait"] = 4.0;
        Constants["network_config_websocket_protocol"] = 5.0;
        Constants["network_config_enable_multicast"] = 6.0;
        Constants["network_config_disable_multicast"] = 7.0;
        Constants["network_avoid_time_wait"] = 4.0;
        Constants["ov_friends"] = 0.0;
        Constants["ov_community"] = 1.0;
        Constants["ov_players"] = 2.0;
        Constants["ov_settings"] = 3.0;
        Constants["ov_gamegroup"] = 4.0;
        Constants["ov_achievements"] = 5.0;
        Constants["lb_sort_none"] = 0.0;
        Constants["lb_sort_ascending"] = 1.0;
        Constants["lb_sort_descending"] = 2.0;
        Constants["lb_disp_none"] = 0.0;
        Constants["lb_disp_numeric"] = 1.0;
        Constants["lb_disp_time_sec"] = 2.0;
        Constants["lb_disp_time_ms"] = 3.0;
        Constants["ugc_result_success"] = 1.0;
        Constants["ugc_filetype_community"] = 0.0;
        Constants["ugc_filetype_microtrans"] = 1.0;
        Constants["ugc_visibility_public"] = 0.0;
        Constants["ugc_visibility_friends_only"] = 1.0;
        Constants["ugc_visibility_private"] = 2.0;
        Constants["ugc_query_RankedByVote"] = 0.0;
        Constants["ugc_query_RankedByPublicationDate"] = 1.0;
        Constants["ugc_query_AcceptedForGameRankedByAcceptanceDate"] = 2.0;
        Constants["ugc_query_RankedByTrend"] = 3.0;
        Constants["ugc_query_FavoritedByFriendsRankedByPublicationDate"] = 4.0;
        Constants["ugc_query_CreatedByFriendsRankedByPublicationDate"] = 5.0;
        Constants["ugc_query_RankedByNumTimesReported"] = 6.0;
        Constants["ugc_query_CreatedByFollowedUsersRankedByPublicationDate"] = 7.0;
        Constants["ugc_query_NotYetRated"] = 8.0;
        Constants["ugc_query_RankedByTotalVotesAsc"] = 9.0;
        Constants["ugc_query_RankedByVotesUp"] = 10.0;
        Constants["ugc_query_RankedByTextSearch"] = 11.0;
        Constants["ugc_sortorder_CreationOrderDesc"] = 0.0;
        Constants["ugc_sortorder_CreationOrderAsc"] = 1.0;
        Constants["ugc_sortorder_TitleAsc"] = 2.0;
        Constants["ugc_sortorder_LastUpdatedDesc"] = 3.0;
        Constants["ugc_sortorder_SubscriptionDateDesc"] = 4.0;
        Constants["ugc_sortorder_VoteScoreDesc"] = 5.0;
        Constants["ugc_sortorder_ForModeration"] = 6.0;
        Constants["ugc_list_Published"] = 0.0;
        Constants["ugc_list_VotedOn"] = 1.0;
        Constants["ugc_list_VotedUp"] = 2.0;
        Constants["ugc_list_VotedDown"] = 3.0;
        Constants["ugc_list_WillVoteLater"] = 4.0;
        Constants["ugc_list_Favorited"] = 5.0;
        Constants["ugc_list_Subscribed"] = 6.0;
        Constants["ugc_list_UsedOrPlayed"] = 7.0;
        Constants["ugc_list_Followed"] = 8.0;
        Constants["ugc_match_Items"] = 0.0;
        Constants["ugc_match_Items_Mtx"] = 1.0;
        Constants["ugc_match_Items_ReadyToUse"] = 2.0;
        Constants["ugc_match_Collections"] = 3.0;
        Constants["ugc_match_Artwork"] = 4.0;
        Constants["ugc_match_Videos"] = 5.0;
        Constants["ugc_match_Screenshots"] = 6.0;
        Constants["ugc_match_AllGuides"] = 7.0;
        Constants["ugc_match_WebGuides"] = 8.0;
        Constants["ugc_match_IntegratedGuides"] = 9.0;
        Constants["ugc_match_UsableInGame"] = 10.0;
        Constants["ugc_match_ControllerBindings"] = 11.0;
        Constants["vertex_usage_position"] = 1.0;
        Constants["vertex_usage_colour"] = 2.0;
        Constants["vertex_usage_color"] = 2.0;
        Constants["vertex_usage_normal"] = 3.0;
        Constants["vertex_usage_textcoord"] = 4.0;
        Constants["vertex_usage_texcoord"] = 4.0;
        Constants["vertex_usage_blendweight"] = 5.0;
        Constants["vertex_usage_blendindices"] = 6.0;
        Constants["vertex_usage_psize"] = 7.0;
        Constants["vertex_usage_tangent"] = 8.0;
        Constants["vertex_usage_binormal"] = 9.0;
        Constants["vertex_usage_fog"] = 12.0;
        Constants["vertex_usage_depth"] = 13.0;
        Constants["vertex_usage_sample"] = 14.0;
        Constants["vertex_type_float1"] = 1.0;
        Constants["vertex_type_float2"] = 2.0;
        Constants["vertex_type_float3"] = 3.0;
        Constants["vertex_type_float4"] = 4.0;
        Constants["vertex_type_colour"] = 5.0;
        Constants["vertex_type_color"] = 5.0;
        Constants["vertex_type_ubyte4"] = 6.0;
        Constants["ds_type_map"] = 1.0;
        Constants["ds_type_list"] = 2.0;
        Constants["ds_type_stack"] = 3.0;
        Constants["ds_type_queue"] = 4.0;
        Constants["ds_type_grid"] = 5.0;
        Constants["ds_type_priority"] = 6.0;
        Constants["iap_ev_storeload"] = 0.0;
        Constants["iap_ev_product"] = 1.0;
        Constants["iap_ev_purchase"] = 2.0;
        Constants["iap_ev_consume"] = 3.0;
        Constants["iap_ev_restore"] = 4.0;
        Constants["iap_storeload_ok"] = 0.0;
        Constants["iap_storeload_failed"] = -1.0;
        Constants["iap_status_uninitialised"] = -2.0;
        Constants["iap_status_unavailable"] = -1.0;
        Constants["iap_status_loading"] = 0.0;
        Constants["iap_status_available"] = 1.0;
        Constants["iap_status_processing"] = 2.0;
        Constants["iap_status_restoring"] = 3.0;
        Constants["iap_failed"] = -3.0;
        Constants["iap_unavailable"] = -2.0;
        Constants["iap_available"] = -1.0;
        Constants["iap_purchased"] = 0.0;
        Constants["iap_canceled"] = 1.0;
        Constants["iap_refunded"] = 2.0;
        Constants["matrix_view"] = 0.0;
        Constants["matrix_projection"] = 1.0;
        Constants["matrix_world"] = 2.0;
        Constants["timezone_local"] = 0.0;
        Constants["timezone_utc"] = 1.0;
        Constants["gamespeed_fps"] = 0.0;
        Constants["gamespeed_microseconds"] = 1.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["spritespeed_framespersecond"] = 0.0;
            Constants["spritespeed_framespergameframe"] = 1.0;
        }
        Constants["xboxone_fileerror_noerror"] = 0.0;
        Constants["xboxone_fileerror_outofmemory"] = 1.0;
        Constants["xboxone_fileerror_usernotfound"] = 2.0;
        Constants["xboxone_fileerror_unknownerror"] = 3.0;
        Constants["xboxone_fileerror_cantopenfile"] = 4.0;
        Constants["xboxone_fileerror_blobnotfound"] = 5.0;
        Constants["xboxone_fileerror_containernotinsync"] = 6.0;
        Constants["xboxone_fileerror_containersyncfailed"] = 7.0;
        Constants["xboxone_fileerror_invalidcontainername"] = 8.0;
        Constants["xboxone_fileerror_noaccess"] = 9.0;
        Constants["xboxone_fileerror_noxboxliveinfo"] = 10.0;
        Constants["xboxone_fileerror_outoflocalstorage"] = 11.0;
        Constants["xboxone_fileerror_providedbuffertoosmall"] = 12.0;
        Constants["xboxone_fileerror_quotaexceeded"] = 13.0;
        Constants["xboxone_fileerror_updatetoobig"] = 14.0;
        Constants["xboxone_fileerror_usercanceled"] = 15.0;
        Constants["xboxone_gamerpic_small"] = 1.0;
        Constants["xboxone_gamerpic_medium"] = 2.0;
        Constants["xboxone_gamerpic_large"] = 3.0;
        Constants["xboxone_agegroup_unknown"] = 0.0;
        Constants["xboxone_agegroup_child"] = 1.0;
        Constants["xboxone_agegroup_teen"] = 2.0;
        Constants["xboxone_agegroup_adult"] = 3.0;
        Constants["xboxone_privilege_internet_browsing"] = 217.0;
        Constants["xboxone_privilege_social_network_sharing"] = 220.0;
        Constants["xboxone_privilege_share_kinect_content"] = 199.0;
        Constants["xboxone_privilege_video_communications"] = 235.0;
        Constants["xboxone_privilege_communications"] = 252.0;
        Constants["xboxone_privilege_user_created_content"] = 247.0;
        Constants["xboxone_privilege_multiplayer_sessions"] = 254.0;
        Constants["xboxone_privilege_sessions"] = 189.0;
        Constants["xboxone_privilege_fitness_upload"] = 195.0;
        Constants["xboxone_privilege_result_aborted"] = 2.0;
        Constants["xboxone_privilege_result_banned"] = 4.0;
        Constants["xboxone_privilege_result_no_issue"] = 0.0;
        Constants["xboxone_privilege_result_purchase_required"] = 1.0;
        Constants["xboxone_privilege_result_restricted"] = 8.0;
        Constants["xboxone_match_visibility_usetemplate"] = 0.0;
        Constants["xboxone_match_visibility_open"] = 1.0;
        Constants["xboxone_match_visibility_private"] = 2.0;
        Constants["xboxlive_fileerror_noerror"] = 0.0;
        Constants["xboxlive_fileerror_outofmemory"] = 1.0;
        Constants["xboxlive_fileerror_usernotfound"] = 2.0;
        Constants["xboxlive_fileerror_unknownerror"] = 3.0;
        Constants["xboxlive_fileerror_cantopenfile"] = 4.0;
        Constants["xboxlive_fileerror_blobnotfound"] = 5.0;
        Constants["xboxlive_fileerror_containernotinsync"] = 6.0;
        Constants["xboxlive_fileerror_containersyncfailed"] = 7.0;
        Constants["xboxlive_fileerror_invalidcontainername"] = 8.0;
        Constants["xboxlive_fileerror_noaccess"] = 9.0;
        Constants["xboxlive_fileerror_noxboxliveinfo"] = 10.0;
        Constants["xboxlive_fileerror_outoflocalstorage"] = 11.0;
        Constants["xboxlive_fileerror_providedbuffertoosmall"] = 12.0;
        Constants["xboxlive_fileerror_quotaexceeded"] = 13.0;
        Constants["xboxlive_fileerror_updatetoobig"] = 14.0;
        Constants["xboxlive_fileerror_usercanceled"] = 15.0;
        Constants["xboxlive_gamerpic_small"] = 1.0;
        Constants["xboxlive_gamerpic_medium"] = 2.0;
        Constants["xboxlive_gamerpic_large"] = 3.0;
        Constants["xboxlive_agegroup_unknown"] = 0.0;
        Constants["xboxlive_agegroup_child"] = 1.0;
        Constants["xboxlive_agegroup_teen"] = 2.0;
        Constants["xboxlive_agegroup_adult"] = 3.0;
        Constants["uwp_privilege_internet_browsing"] = 217.0;
        Constants["uwp_privilege_social_network_sharing"] = 220.0;
        Constants["uwp_privilege_share_kinect_content"] = 199.0;
        Constants["uwp_privilege_video_communications"] = 235.0;
        Constants["uwp_privilege_communications"] = 252.0;
        Constants["uwp_privilege_user_created_content"] = 247.0;
        Constants["uwp_privilege_multiplayer_sessions"] = 254.0;
        Constants["uwp_privilege_sessions"] = 189.0;
        Constants["uwp_privilege_fitness_upload"] = 195.0;
        Constants["uwp_privilege_result_aborted"] = 2.0;
        Constants["uwp_privilege_result_banned"] = 4.0;
        Constants["uwp_privilege_result_no_issue"] = 0.0;
        Constants["uwp_privilege_result_purchase_required"] = 1.0;
        Constants["uwp_privilege_result_restricted"] = 8.0;
        Constants["xboxlive_match_visibility_usetemplate"] = 0.0;
        Constants["xboxlive_match_visibility_open"] = 1.0;
        Constants["xboxlive_match_visibility_private"] = 2.0;
        Constants["PSN_LEADERBOARD_SCORE_MSG"] = 2001.0;
        Constants["PSN_LEADERBOARD_SCORE_RANGE_MSG"] = 2002.0;
        Constants["PSN_LEADERBOARD_FRIENDS_SCORES_MSG"] = 2003.0;
        Constants["PSN_LEADERBOARD_SCORE_POSTED_MSG"] = 2004.0;
        Constants["PSN_TROPHY_INFO_MSG"] = 102.0;
        Constants["PSN_TROPHY_UNLOCKED_MSG"] = 101.0;
        Constants["PSN_TROPHY_UNLOCK_STATE"] = 103.0;
        Constants["MATCHMAKING_CONNECTION"] = 3001.0;
        Constants["MATCHMAKING_SESSION"] = 3002.0;
        Constants["MATCHMAKING_INVITATION"] = 4001.0;
        Constants["MATCHMAKING_PLAY_TOGETHER"] = 4002.0;
        Constants["PSN_SERVICE_STATE"] = 5001.0;
        Constants["MATCHMAKING_OPERATOR_EQUAL"] = 1.0;
        Constants["MATCHMAKING_OPERATOR_NOTEQUAL"] = 2.0;
        Constants["MATCHMAKING_OPERATOR_LESSTHAN"] = 3.0;
        Constants["MATCHMAKING_OPERATOR_LESSTHANOREQUAL"] = 4.0;
        Constants["MATCHMAKING_OPERATOR_GREATERTHAN"] = 5.0;
        Constants["MATCHMAKING_OPERATOR_GREATERTHANOREQUAL"] = 6.0;
        Constants["switch_controller_joycon_holdtype_vertical"] = 0.0;
        Constants["switch_controller_joycon_holdtype_horizontal"] = 1.0;
        Constants["switch_controller_handheld"] = 1.0;
        Constants["switch_controller_pro_controller"] = 2.0;
        Constants["switch_controller_joycon_dual"] = 4.0;
        Constants["switch_controller_joycon_left"] = 8.0;
        Constants["switch_controller_joycon_right"] = 16.0;
        Constants["switch_controller_motor_single"] = 0.0;
        Constants["switch_controller_motor_left"] = 0.0;
        Constants["switch_controller_motor_right"] = 1.0;
        Constants["switch_theme_default"] = 0.0;
        Constants["switch_theme_user"] = 1.0;
        Constants["switch_theme_white"] = 2.0;
        Constants["switch_theme_black"] = 3.0;
        Constants["switch_screenshot_rotation_none"] = 0.0;
        Constants["switch_screenshot_rotation_90"] = 1.0;
        Constants["switch_screenshot_rotation_180"] = 2.0;
        Constants["switch_screenshot_rotation_270"] = 3.0;
        Constants["switch_controller_axis_x"] = 0.0;
        Constants["switch_controller_axis_y"] = 1.0;
        Constants["switch_controller_axis_z"] = 2.0;
        Constants["switch_irsensor_light_target_all"] = 0.0;
        Constants["switch_irsensor_light_target_far"] = 1.0;
        Constants["switch_irsensor_light_target_near"] = 2.0;
        Constants["switch_irsensor_light_target_none"] = 3.0;
        Constants["switch_irsensor_ambient_noise_low"] = 0.0;
        Constants["switch_irsensor_ambient_noise_middle"] = 1.0;
        Constants["switch_irsensor_ambient_noise_high"] = 2.0;
        Constants["switch_irsensor_ambient_noise_unknown"] = 3.0;
        Constants["switch_irsensor_mode_none"] = 0.0;
        Constants["switch_irsensor_mode_moment"] = 1.0;
        Constants["switch_irsensor_mode_cluster"] = 2.0;
        Constants["switch_irsensor_mode_image"] = 3.0;
        Constants["switch_irsensor_mode_hand"] = 4.0;
        Constants["switch_irsensor_moment_preprocess_binarize"] = 0.0;
        Constants["switch_irsensor_moment_preprocess_cutoff"] = 1.0;
        Constants["switch_irsensor_hand_mode_none"] = 0.0;
        Constants["switch_irsensor_hand_mode_silhouette"] = 1.0;
        Constants["switch_irsensor_hand_mode_image"] = 2.0;
        Constants["switch_irsensor_hand_mode_silhouette_and_image"] = 3.0;
        Constants["switch_irsensor_hand_mode_silhouette_only"] = 4.0;
        Constants["switch_irsensor_image_format_qvga"] = 0.0;
        Constants["switch_irsensor_image_format_qqvga"] = 1.0;
        Constants["switch_irsensor_image_format_qqqvga"] = 2.0;
        Constants["switch_irsensor_image_format_320x240"] = 0.0;
        Constants["switch_irsensor_image_format_160x120"] = 1.0;
        Constants["switch_irsensor_image_format_80x60"] = 2.0;
        Constants["switch_irsensor_image_format_40x30"] = 3.0;
        Constants["switch_irsensor_image_format_20x15"] = 4.0;
        Constants["switch_irsensor_hand_chirality_left"] = 1.0;
        Constants["switch_irsensor_hand_chirality_right"] = 2.0;
        Constants["switch_irsensor_hand_chirality_unknown"] = 3.0;
        Constants["switch_irsensor_hand_finger_thumb"] = 0.0;
        Constants["switch_irsensor_hand_finger_index"] = 1.0;
        Constants["switch_irsensor_hand_finger_middle"] = 2.0;
        Constants["switch_irsensor_hand_finger_ring"] = 3.0;
        Constants["switch_irsensor_hand_finger_little"] = 4.0;
        Constants["switch_irsensor_hand_finger_count"] = 5.0;
        Constants["switch_irsensor_hand_touching_index_middle"] = 0.0;
        Constants["switch_irsensor_hand_touching_middle_ring"] = 1.0;
        Constants["switch_irsensor_hand_touching_ring_little"] = 2.0;
        Constants["switch_irsensor_hand_touching_count"] = 3.0;
        Constants["switch_controller_handheld_activation_dual"] = 0.0;
        Constants["switch_controller_handheld_activation_single"] = 1.0;
        Constants["switch_controller_handheld_activation_none"] = 2.0;
        Constants["switch_performance_mode_invalid"] = -1.0;
        Constants["switch_performance_mode_normal"] = 0.0;
        Constants["switch_performance_mode_boost"] = 1.0;
        Constants["switch_performance_config_invalid"] = 0.0;
        Constants["switch_performance_config_Cpu1020MhzGpu768MhzEmc1600Mhz"] = 65537.0;
        Constants["switch_performance_config_Cpu1020MhzGpu307MhzEmc1331Mhz"] = 131075.0;
        Constants["switch_performance_config_Cpu1020MhzGpu384MhzEmc1331Mhz"] = 131076.0;
        Constants["fb_login_default"] = 0.0;
        Constants["fb_login_fallback_to_webview"] = 1.0;
        Constants["fb_login_no_fallback_to_webview"] = 2.0;
        Constants["fb_login_forcing_webview"] = 3.0;
        Constants["fb_login_use_system_account"] = 4.0;
        Constants["fb_login_forcing_safari"] = 5.0;
        Constants["path_action_stop"] = 0.0;
        Constants["path_action_restart"] = 1.0;
        Constants["path_action_continue"] = 2.0;
        Constants["path_action_reverse"] = 3.0;
        Constants["vbm_fast"] = 0.0;
        Constants["vbm_compatible"] = 1.0;
        Constants["vbm_most_compatible"] = 2.0;
        Constants["tm_sleep"] = 0.0;
        Constants["tm_countvsyncs"] = 1.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["layerelementtype_undefined"] = 0.0;
            Constants["layerelementtype_background"] = 1.0;
            Constants["layerelementtype_instance"] = 2.0;
            Constants["layerelementtype_oldtilemap"] = 3.0;
            Constants["layerelementtype_sprite"] = 4.0;
            Constants["layerelementtype_tilemap"] = 5.0;
            Constants["layerelementtype_particlesystem"] = 6.0;
            Constants["layerelementtype_tile"] = 7.0;
            Constants["tile_rotate"] = 1073741824.0;
            Constants["tile_flip"] = 536870912.0;
            Constants["tile_mirror"] = 268435456.0;
            Constants["tile_index_mask"] = 524287.0;
        }
        Constants["cmpfunc_never"] = 1.0;
        Constants["cmpfunc_less"] = 2.0;
        Constants["cmpfunc_equal"] = 3.0;
        Constants["cmpfunc_lessequal"] = 4.0;
        Constants["cmpfunc_greater"] = 5.0;
        Constants["cmpfunc_notequal"] = 6.0;
        Constants["cmpfunc_greaterequal"] = 7.0;
        Constants["cmpfunc_always"] = 8.0;
        Constants["cull_noculling"] = 0.0;
        Constants["cull_clockwise"] = 1.0;
        Constants["cull_counterclockwise"] = 2.0;
        Constants["lighttype_dir"] = 0.0;
        Constants["lighttype_point"] = 1.0;
        if (data?.GeneralInfo?.Major >= 2)
        {
            Constants["kbv_type_default"] = 0.0;
            Constants["kbv_type_ascii"] = 1.0;
            Constants["kbv_type_url"] = 2.0;
            Constants["kbv_type_email"] = 3.0;
            Constants["kbv_type_numbers"] = 4.0;
            Constants["kbv_type_phone"] = 5.0;
            Constants["kbv_type_phone_name"] = 6.0;
            Constants["kbv_returnkey_default"] = 0.0;
            Constants["kbv_returnkey_go"] = 1.0;
            Constants["kbv_returnkey_google"] = 2.0;
            Constants["kbv_returnkey_join"] = 3.0;
            Constants["kbv_returnkey_next"] = 4.0;
            Constants["kbv_returnkey_route"] = 5.0;
            Constants["kbv_returnkey_search"] = 6.0;
            Constants["kbv_returnkey_send"] = 7.0;
            Constants["kbv_returnkey_yahoo"] = 8.0;
            Constants["kbv_returnkey_done"] = 9.0;
            Constants["kbv_returnkey_continue"] = 10.0;
            Constants["kbv_returnkey_emergency"] = 11.0;
            Constants["kbv_autocapitalize_none"] = 0.0;
            Constants["kbv_autocapitalize_words"] = 1.0;
            Constants["kbv_autocapitalize_sentences"] = 2.0;
            Constants["kbv_autocapitalize_characters"] = 3.0;
        }
        // This one is a special case; it only exports to browser. I don't think this library supports
        // browser at all though, so we'll just assume it's -1. Wouldn't hurt anyway.
        Constants["os_browser"] = -1.0;

        // Moving on to the variables
        GlobalNotArray = new(128);
        GlobalArray = new(128);

        GlobalNotArray["argument_relative"] = new VariableInfo("argument_relative", true, false);
        GlobalNotArray["argument_count"] = new VariableInfo("argument_count", true, false);
        GlobalNotArray["argument"] = new VariableInfo("argument", true, true);
        GlobalNotArray["argument0"] = new VariableInfo("argument0", true, true);
        GlobalNotArray["argument1"] = new VariableInfo("argument1", true, true);
        GlobalNotArray["argument2"] = new VariableInfo("argument2", true, true);
        GlobalNotArray["argument3"] = new VariableInfo("argument3", true, true);
        GlobalNotArray["argument4"] = new VariableInfo("argument4", true, true);
        GlobalNotArray["argument5"] = new VariableInfo("argument5", true, true);
        GlobalNotArray["argument6"] = new VariableInfo("argument6", true, true);
        GlobalNotArray["argument7"] = new VariableInfo("argument7", true, true);
        GlobalNotArray["argument8"] = new VariableInfo("argument8", true, true);
        GlobalNotArray["argument9"] = new VariableInfo("argument9", true, true);
        GlobalNotArray["argument10"] = new VariableInfo("argument10", true, true);
        GlobalNotArray["argument11"] = new VariableInfo("argument11", true, true);
        GlobalNotArray["argument12"] = new VariableInfo("argument12", true, true);
        GlobalNotArray["argument13"] = new VariableInfo("argument13", true, true);
        GlobalNotArray["argument14"] = new VariableInfo("argument14", true, true);
        GlobalNotArray["argument15"] = new VariableInfo("argument15", true, true);
        GlobalNotArray["debug_mode"] = new VariableInfo("debug_mode", true, false);
        GlobalNotArray["pointer_invalid"] = new VariableInfo("pointer_invalid", true, false);
        GlobalNotArray["pointer_null"] = new VariableInfo("pointer_null", true, false);
        GlobalNotArray["undefined"] = new VariableInfo("undefined", true, false);
        if (data?.GeneralInfo?.Major >= 2)
        {
            GlobalNotArray["infinity"] = new VariableInfo("infinity", true, false);
            GlobalNotArray["NaN"] = new VariableInfo("NaN", true, false);
        }
        GlobalNotArray["room"] = new VariableInfo("room", true, true);
        GlobalNotArray["room_first"] = new VariableInfo("room_first", true, false);
        GlobalNotArray["room_last"] = new VariableInfo("room_last", true, false);
        GlobalNotArray["transition_kind"] = new VariableInfo("transition_kind", true, true);
        GlobalNotArray["transition_steps"] = new VariableInfo("transition_steps", true, true);
        GlobalNotArray["score"] = new VariableInfo("score", true, true);
        GlobalNotArray["lives"] = new VariableInfo("lives", true, true);
        GlobalNotArray["health"] = new VariableInfo("health", true, true);
        GlobalNotArray["game_id"] = new VariableInfo("game_id", true, false);
        GlobalNotArray["game_display_name"] = new VariableInfo("game_display_name", true, false);
        GlobalNotArray["game_project_name"] = new VariableInfo("game_project_name", true, false);
        GlobalNotArray["game_save_id"] = new VariableInfo("game_save_id", true, false);
        GlobalNotArray["working_directory"] = new VariableInfo("working_directory", true, false);
        GlobalNotArray["temp_directory"] = new VariableInfo("temp_directory", true, false);
        GlobalNotArray["program_directory"] = new VariableInfo("program_directory", true, false);
        GlobalNotArray["instance_count"] = new VariableInfo("instance_count", true, false);
        GlobalNotArray["instance_id"] = new VariableInfo("instance_id", true, false);
        GlobalNotArray["room_width"] = new VariableInfo("room_width", true, true);
        GlobalNotArray["room_height"] = new VariableInfo("room_height", true, true);
        GlobalNotArray["room_caption"] = new VariableInfo("room_caption", true, true);
        GlobalNotArray["room_speed"] = new VariableInfo("room_speed", true, true);
        GlobalNotArray["room_persistent"] = new VariableInfo("room_persistent", true, true);
        GlobalNotArray["background_color"] = new VariableInfo("background_color", true, true);
        GlobalNotArray["background_showcolor"] = new VariableInfo("background_showcolor", true, true);
        GlobalNotArray["background_colour"] = new VariableInfo("background_colour", true, true);
        GlobalNotArray["background_showcolour"] = new VariableInfo("background_showcolour", true, true);
        if (data?.GeneralInfo?.Major < 2)
        {
            GlobalArray["background_visible"] = new VariableInfo("background_visible", true, true, true);
            GlobalArray["background_foreground"] = new VariableInfo("background_foreground", true, true, true);
            GlobalArray["background_index"] = new VariableInfo("background_index", true, true, true);
            GlobalArray["background_x"] = new VariableInfo("background_x", true, true, true);
            GlobalArray["background_y"] = new VariableInfo("background_y", true, true, true);
            GlobalArray["background_width"] = new VariableInfo("background_width", true, false, true);
            GlobalArray["background_height"] = new VariableInfo("background_height", true, false, true);
            GlobalArray["background_htiled"] = new VariableInfo("background_htiled", true, true, true);
            GlobalArray["background_vtiled"] = new VariableInfo("background_vtiled", true, true, true);
            GlobalArray["background_xscale"] = new VariableInfo("background_xscale", true, true, true);
            GlobalArray["background_yscale"] = new VariableInfo("background_yscale", true, true, true);
            GlobalArray["background_hspeed"] = new VariableInfo("background_hspeed", true, true, true);
            GlobalArray["background_vspeed"] = new VariableInfo("background_vspeed", true, true, true);
            GlobalArray["background_blend"] = new VariableInfo("background_blend", true, true, true);
            GlobalArray["background_alpha"] = new VariableInfo("background_alpha", true, true, true);
        }
        GlobalNotArray["view_enabled"] = new VariableInfo("view_enabled", true, true);
        GlobalNotArray["view_current"] = new VariableInfo("view_current", true, false);
        GlobalNotArray["view_visible"] = new VariableInfo("view_visible", true, true);
        GlobalArray["view_xview"] = new VariableInfo("view_xview", true, true, true);
        GlobalArray["view_yview"] = new VariableInfo("view_yview", true, true, true);
        GlobalArray["view_wview"] = new VariableInfo("view_wview", true, true, true);
        GlobalArray["view_hview"] = new VariableInfo("view_hview", true, true, true);
        GlobalArray["view_angle"] = new VariableInfo("view_angle", true, true, true);
        GlobalArray["view_hborder"] = new VariableInfo("view_hborder", true, true, true);
        GlobalArray["view_vborder"] = new VariableInfo("view_vborder", true, true, true);
        GlobalArray["view_hspeed"] = new VariableInfo("view_hspeed", true, true, true);
        GlobalArray["view_vspeed"] = new VariableInfo("view_vspeed", true, true, true);
        GlobalArray["view_object"] = new VariableInfo("view_object", true, true, true);
        GlobalArray["view_xport"] = new VariableInfo("view_xport", true, true, true);
        GlobalArray["view_yport"] = new VariableInfo("view_yport", true, true, true);
        GlobalArray["view_wport"] = new VariableInfo("view_wport", true, true, true);
        GlobalArray["view_hport"] = new VariableInfo("view_hport", true, true, true);
        GlobalArray["view_surface_id"] = new VariableInfo("view_surface_id", true, true, true);
        GlobalArray["view_camera"] = new VariableInfo("view_camera", true, true, true);
        GlobalNotArray["mouse_x"] = new VariableInfo("mouse_x", true, false);
        GlobalNotArray["mouse_y"] = new VariableInfo("mouse_y", true, false);
        GlobalNotArray["mouse_button"] = new VariableInfo("mouse_button", true, true);
        GlobalNotArray["mouse_lastbutton"] = new VariableInfo("mouse_lastbutton", true, true);
        GlobalNotArray["keyboard_key"] = new VariableInfo("keyboard_key", true, true);
        GlobalNotArray["keyboard_lastkey"] = new VariableInfo("keyboard_lastkey", true, true);
        GlobalNotArray["keyboard_lastchar"] = new VariableInfo("keyboard_lastchar", true, true);
        GlobalNotArray["keyboard_string"] = new VariableInfo("keyboard_string", true, true);
        GlobalNotArray["show_score"] = new VariableInfo("show_score", true, true);
        GlobalNotArray["show_lives"] = new VariableInfo("show_lives", true, true);
        GlobalNotArray["show_health"] = new VariableInfo("show_health", true, true);
        GlobalNotArray["caption_score"] = new VariableInfo("caption_score", true, true);
        GlobalNotArray["caption_lives"] = new VariableInfo("caption_lives", true, true);
        GlobalNotArray["caption_health"] = new VariableInfo("caption_health", true, true);
        GlobalNotArray["fps"] = new VariableInfo("fps", true, false);
        GlobalNotArray["fps_real"] = new VariableInfo("fps_real", true, false);
        GlobalNotArray["current_time"] = new VariableInfo("current_time", true, false);
        GlobalNotArray["current_year"] = new VariableInfo("current_year", true, false);
        GlobalNotArray["current_month"] = new VariableInfo("current_month", true, false);
        GlobalNotArray["current_day"] = new VariableInfo("current_day", true, false);
        GlobalNotArray["current_weekday"] = new VariableInfo("current_weekday", true, false);
        GlobalNotArray["current_hour"] = new VariableInfo("current_hour", true, false);
        GlobalNotArray["current_minute"] = new VariableInfo("current_minute", true, false);
        GlobalNotArray["current_second"] = new VariableInfo("current_second", true, false);
        GlobalNotArray["event_type"] = new VariableInfo("event_type", true, false);
        GlobalNotArray["event_number"] = new VariableInfo("event_number", true, false);
        GlobalNotArray["event_object"] = new VariableInfo("event_object", true, false);
        GlobalNotArray["event_action"] = new VariableInfo("event_action", true, false);
        GlobalNotArray["error_occurred"] = new VariableInfo("error_occurred", true, true);
        GlobalNotArray["error_last"] = new VariableInfo("error_last", true, true);
        GlobalNotArray["gamemaker_registered"] = new VariableInfo("gamemaker_registered", true, false);
        GlobalNotArray["gamemaker_pro"] = new VariableInfo("gamemaker_pro", true, false);
        GlobalNotArray["application_surface"] = new VariableInfo("application_surface", true, false);
        if (data?.GeneralInfo?.Major >= 2)
        {
            GlobalNotArray["font_texture_page_size"] = new VariableInfo("font_texture_page_size", true, true);
        }
        GlobalNotArray["os_type"] = new VariableInfo("os_type", true, false);
        GlobalNotArray["os_device"] = new VariableInfo("os_device", true, false);
        GlobalNotArray["os_version"] = new VariableInfo("os_version", true, false);
        GlobalNotArray["browser_width"] = new VariableInfo("browser_width", true, false);
        GlobalNotArray["browser_height"] = new VariableInfo("browser_height", true, false);
        GlobalNotArray["async_load"] = new VariableInfo("async_load", true, false);
        GlobalNotArray["event_data"] = new VariableInfo("event_data", true, false);
        GlobalNotArray["display_aa"] = new VariableInfo("display_aa", true, false);
        GlobalNotArray["iap_data"] = new VariableInfo("iap_data", true, false);
        GlobalNotArray["cursor_sprite"] = new VariableInfo("cursor_sprite", true, true);
        GlobalNotArray["delta_time"] = new VariableInfo("delta_time", true, true);
        GlobalNotArray["webgl_enabled"] = new VariableInfo("webgl_enabled", true, false);

        // Now onto instance variables
        Instance = new Dictionary<string, VariableInfo>
        {
            ["x"] = new VariableInfo("x", false, true),
            ["y"] = new VariableInfo("y", false, true),
            ["xprevious"] = new VariableInfo("xprevious", false, true),
            ["yprevious"] = new VariableInfo("yprevious", false, true),
            ["xstart"] = new VariableInfo("xstart", false, true),
            ["ystart"] = new VariableInfo("ystart", false, true),
            ["hspeed"] = new VariableInfo("hspeed", false, true),
            ["vspeed"] = new VariableInfo("vspeed", false, true),
            ["direction"] = new VariableInfo("direction", false, true),
            ["speed"] = new VariableInfo("speed", false, true),
            ["friction"] = new VariableInfo("friction", false, true),
            ["gravity"] = new VariableInfo("gravity", false, true),
            ["gravity_direction"] = new VariableInfo("gravity_direction", false, true),
            ["object_index"] = new VariableInfo("object_index", false, false),
            ["id"] = new VariableInfo("id", false, false),
            ["alarm"] = new VariableInfo("alarm", false, true),
            ["solid"] = new VariableInfo("solid", false, true),
            ["visible"] = new VariableInfo("visible", false, true),
            ["persistent"] = new VariableInfo("persistent", false, true),
            ["depth"] = new VariableInfo("depth", false, true),
            ["bbox_left"] = new VariableInfo("bbox_left", false, false),
            ["bbox_right"] = new VariableInfo("bbox_right", false, false),
            ["bbox_top"] = new VariableInfo("bbox_top", false, false),
            ["bbox_bottom"] = new VariableInfo("bbox_bottom", false, false),
            ["sprite_index"] = new VariableInfo("sprite_index", false, true),
            ["image_index"] = new VariableInfo("image_index", false, true),
            ["image_single"] = new VariableInfo("image_single", false, true),
            ["image_number"] = new VariableInfo("image_number", false, false),
            ["sprite_width"] = new VariableInfo("sprite_width", false, false),
            ["sprite_height"] = new VariableInfo("sprite_height", false, false),
            ["sprite_xoffset"] = new VariableInfo("sprite_xoffset", false, false),
            ["sprite_yoffset"] = new VariableInfo("sprite_yoffset", false, false),
            ["image_xscale"] = new VariableInfo("image_xscale", false, true),
            ["image_yscale"] = new VariableInfo("image_yscale", false, true),
            ["image_angle"] = new VariableInfo("image_angle", false, true),
            ["image_alpha"] = new VariableInfo("image_alpha", false, true),
            ["image_blend"] = new VariableInfo("image_blend", false, true),
            ["image_speed"] = new VariableInfo("image_speed", false, true),
            ["mask_index"] = new VariableInfo("mask_index", false, true),
            ["path_index"] = new VariableInfo("path_index", false, false),
            ["path_position"] = new VariableInfo("path_position", false, true),
            ["path_positionprevious"] = new VariableInfo("path_positionprevious", false, true),
            ["path_speed"] = new VariableInfo("path_speed", false, true),
            ["path_scale"] = new VariableInfo("path_scale", false, true),
            ["path_orientation"] = new VariableInfo("path_orientation", false, true),
            ["path_endaction"] = new VariableInfo("path_endaction", false, true),
            ["timeline_index"] = new VariableInfo("timeline_index", false, true),
            ["timeline_position"] = new VariableInfo("timeline_position", false, true),
            ["timeline_speed"] = new VariableInfo("timeline_speed", false, true),
            ["timeline_running"] = new VariableInfo("timeline_running", false, true),
            ["timeline_loop"] = new VariableInfo("timeline_loop", false, true),
            ["phy_rotation"] = new VariableInfo("phy_rotation", false, true),
            ["phy_position_x"] = new VariableInfo("phy_position_x", false, true),
            ["phy_position_y"] = new VariableInfo("phy_position_y", false, true),
            ["phy_angular_velocity"] = new VariableInfo("phy_angular_velocity", false, true),
            ["phy_linear_velocity_x"] = new VariableInfo("phy_linear_velocity_x", false, true),
            ["phy_linear_velocity_y"] = new VariableInfo("phy_linear_velocity_y", false, true),
            ["phy_speed_x"] = new VariableInfo("phy_speed_x", false, true),
            ["phy_speed_y"] = new VariableInfo("phy_speed_y", false, true),
            ["phy_speed"] = new VariableInfo("phy_speed", false, false),
            ["phy_angular_damping"] = new VariableInfo("phy_angular_damping", false, true),
            ["phy_linear_damping"] = new VariableInfo("phy_linear_damping", false, true),
            ["phy_bullet"] = new VariableInfo("phy_bullet", false, true),
            ["phy_fixed_rotation"] = new VariableInfo("phy_fixed_rotation", false, true),
            ["phy_active"] = new VariableInfo("phy_active", false, true),
            ["phy_mass"] = new VariableInfo("phy_mass", false, false),
            ["phy_inertia"] = new VariableInfo("phy_inertia", false, false),
            ["phy_com_x"] = new VariableInfo("phy_com_x", false, false),
            ["phy_com_y"] = new VariableInfo("phy_com_y", false, false),
            ["phy_dynamic"] = new VariableInfo("phy_dynamic", false, false),
            ["phy_kinematic"] = new VariableInfo("phy_kinematic", false, false),
            ["phy_sleeping"] = new VariableInfo("phy_sleeping", false, false),
            ["phy_position_xprevious"] = new VariableInfo("phy_position_xprevious", false, true),
            ["phy_position_yprevious"] = new VariableInfo("phy_position_yprevious", false, true),
            ["phy_collision_points"] = new VariableInfo("phy_collision_points", false, false)
        };

        // There are some of them that are only available in certain physics events
        InstanceLimitedEvent = new Dictionary<string, VariableInfo>
        {
            ["phy_collision_x"] = new VariableInfo("phy_collision_x", false, false, true),
            ["phy_collision_y"] = new VariableInfo("phy_collision_y", false, false, true),
            ["phy_col_normal_x"] = new VariableInfo("phy_col_normal_x", false, false, true),
            ["phy_col_normal_y"] = new VariableInfo("phy_col_normal_y", false, false, true)
        };
    }
}
